Simple WordPress question

Discussion in 'WordPress' started by I. Brian, Oct 17, 2005.

  1. #1
    The Kubrick template that defaults with Wordpress has a nice feature where entries on the main and category index pages are shown as excerpts, but on the individual entry templates are full text.

    What would I need to use in a custom template to replicate this feature?

    Replies much appreciated. :)
     
    I. Brian, Oct 17, 2005 IP
  2. SEbasic

    SEbasic Peon

    Messages:
    6,317
    Likes Received:
    318
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <?php the_excerpt() ?> as the output for the actual post...

    (I think that's right)...
     
    SEbasic, Oct 17, 2005 IP
  3. WhatiFind

    WhatiFind offline

    Messages:
    1,789
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    180
    #3
    WhatiFind, Oct 17, 2005 IP
    dct likes this.
  4. I. Brian

    I. Brian Business consultant

    Messages:
    810
    Likes Received:
    59
    Best Answers:
    1
    Trophy Points:
    145
    #4
    <?php if($p) {the_content(); } else {the_excerpt(); } ?>
    Code (markup):
    That's *exactly* what I was looking for - many thanks for that. :)

    I'd green rep you, but I have to spread more around, so if anyone would like to do the honours and green rep WhatiFind it would be appreciated. :)
     
    I. Brian, Oct 17, 2005 IP
  5. WhatiFind

    WhatiFind offline

    Messages:
    1,789
    Likes Received:
    257
    Best Answers:
    0
    Trophy Points:
    180
    #5
    Thanks for the positive press! :)
     
    WhatiFind, Oct 17, 2005 IP
  6. sarahk

    sarahk iTamer Staff

    Messages:
    28,909
    Likes Received:
    4,555
    Best Answers:
    124
    Trophy Points:
    665
    #6
    It's actually been really interesting hacking around with templates lately and learning new commands - and your template has been part of that process.

    Any good tutorials on what the standard variables and functions are and what they do?

    For instance

    <?php if ( is_home() || is_page() ) { ?>
    Code (markup):
    I've used is_home() on my template and it still applies to all the subsequent index pages, but not to the individual posts or to "pages". I could check the function itself but a simple guide would be good for the less PHP-literate.

    Sarah
     
    sarahk, Oct 18, 2005 IP