Latest Articles - Showing full post

Discussion in 'WordPress' started by El Nino, Jan 17, 2010.

  1. #1
    On my wordpress blog on the front page it shows the WHOLE article there, whereas i want it to show a snippet so they click on the article to another page.
    www.completefootball.com < this is what i mean, how do i change it to show like a couple of hundred words instead of the whole thing?
     
    El Nino, Jan 17, 2010 IP
  2. craiger22

    craiger22 Well-Known Member

    Messages:
    1,472
    Likes Received:
    99
    Best Answers:
    0
    Trophy Points:
    170
    #2
    In your themes main index file you will need to replace the_content() with the_excerpt
     
    craiger22, Jan 17, 2010 IP
  3. theapparatus

    theapparatus Peon

    Messages:
    2,925
    Likes Received:
    119
    Best Answers:
    0
    Trophy Points:
    0
    #3
    When you do that, you may also want to go through and do the same to the theme's category.php and archive.php files. These are the templates that display the Category, Tag and Date pages and you'll probably want to do the same for those.

    Hope this helps,
    -drmike
     
    theapparatus, Jan 17, 2010 IP
  4. El Nino

    El Nino Peon

    Messages:
    145
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hmm, i tried what you said. is there anyway to get it a bit longer?
     
    El Nino, Jan 17, 2010 IP
  5. theapparatus

    theapparatus Peon

    Messages:
    2,925
    Likes Received:
    119
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Not with the function.

    If you need more control, please consider using the 'more' tag.

    http://en.support.wordpress.com/splitting-content/more-tag/
    Code (markup):
    Be real careful with that as last time I knew, it doesnt close html tags and could break your css.
     
    theapparatus, Jan 17, 2010 IP
  6. craiger22

    craiger22 Well-Known Member

    Messages:
    1,472
    Likes Received:
    99
    Best Answers:
    0
    Trophy Points:
    170
    #6
    if you want to adjust the length you can add the following to your themes functions.php file:

    
    function new_excerpt_length($length) {
    	return 20;
    }
    add_filter('excerpt_length', 'new_excerpt_length');
    
    Code (markup):
    Replace the 20 with how many words you want to use.
     
    craiger22, Jan 17, 2010 IP
  7. seojonrich

    seojonrich Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7


    thanks for that, wordpress is still new to me so tags like this are perfect

    cheers
     
    seojonrich, Jan 18, 2010 IP
  8. craiger22

    craiger22 Well-Known Member

    Messages:
    1,472
    Likes Received:
    99
    Best Answers:
    0
    Trophy Points:
    170
    #8
    Anytime, I started learnin litle tricks like this to cut back on the amount of plugins I rly on. It all come swith time.
     
    craiger22, Jan 18, 2010 IP