WP Blog Question

Discussion in 'Blogging' started by spsfinest, Aug 25, 2009.

  1. spsfinest

    spsfinest Junior Member

    Joined:
    Jul 25, 2009
    Messages:
    192
    Likes Received:
    26
    Occupation:
    IM
    Location:
    U.S.
    How do I get my Wordpress theme to only show a excerpt of my posts on the main page?
     
  2. cristianraiber

    cristianraiber Regular Member

    Joined:
    Nov 22, 2008
    Messages:
    293
    Likes Received:
    381
    Occupation:
    Onliner
    Location:
    Internet
    Go to theme editor -> index.php -> locate the code line that says
    Code:
    <?php the content(); ?> 
    and change it to
    Code:
    <?php the_excerpt(); ?>
    done :)
     
  3. spsfinest

    spsfinest Junior Member

    Joined:
    Jul 25, 2009
    Messages:
    192
    Likes Received:
    26
    Occupation:
    IM
    Location:
    U.S.
    my index.php code is this, do I just replace primary content to excerpt?

    <?php get_header(); ?>
    <div id="primary-content">
    <?php include (TEMPLATEPATH . '/theloop.php'); ?>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
     
  4. cristianraiber

    cristianraiber Regular Member

    Joined:
    Nov 22, 2008
    Messages:
    293
    Likes Received:
    381
    Occupation:
    Onliner
    Location:
    Internet
    well, in this case open up theloop.php and try looking for <?php the_content(); ?> and replacing it there.
     
    • Thanks Thanks x 1
  5. spsfinest

    spsfinest Junior Member

    Joined:
    Jul 25, 2009
    Messages:
    192
    Likes Received:
    26
    Occupation:
    IM
    Location:
    U.S.
  6. darkmobius

    darkmobius Regular Member

    Joined:
    Jul 16, 2008
    Messages:
    238
    Likes Received:
    227
    Occupation:
    software developer
    Location:
    canada
    just to help you a bit more
    <div id="primary-content"> that you mentioned is only a div tag with a particular css style called primary-content. You should be able to find it in the css style file (probably styles.css)
     
  7. RudeMaudlin

    RudeMaudlin Registered Member

    Joined:
    Apr 8, 2009
    Messages:
    65
    Likes Received:
    335
    Location:
    Australia
    replace
    Code:
    <?php the_content() ?>
    with
    Code:
    <?php the_excerpt() ?>
    inside the post template.
     
  8. cristianraiber

    cristianraiber Regular Member

    Joined:
    Nov 22, 2008
    Messages:
    293
    Likes Received:
    381
    Occupation:
    Onliner
    Location:
    Internet
    btw, after

    Code:
    <?php the_excerpt(); ?> 
    add this piece of code:

    Code:
    <a href="<?php the_permalink(); ?>">Read More</a>
     
  9. spsfinest

    spsfinest Junior Member

    Joined:
    Jul 25, 2009
    Messages:
    192
    Likes Received:
    26
    Occupation:
    IM
    Location:
    U.S.
    Thank you cristianraider, your a very helpful person
     
  10. godmonkee

    godmonkee Regular Member

    Joined:
    Jan 12, 2009
    Messages:
    396
    Likes Received:
    769
    Occupation:
    IM
    Location:
    Gallifrey
    Or when you type your posts you just add a page break in between the post and then when you look at the main page, you get a little bit of text and then read more option.

    Godmonkee
     
  11. OnFire25

    OnFire25 Registered Member

    Joined:
    Mar 24, 2008
    Messages:
    73
    Likes Received:
    218

    This is a plugin that does the job - you can even say how many words to display before the ---- more------ cuts in.


    Code:
    Evermore
    
    Abbreviate all posts when viewed on multiple post pages. This makes all posts behave as if there is a ?<!?more?>? at an appropriate spot inside the content
    
    http://www.thunderguy.com/semicolon/wordpress/evermore-wordpress-plugin/
    
    


    Enjoy:D