• When I write a post I’d like to be able to use the Excerpt box so only a few words are displayed on my home page for each post. However, whenever I put some text in the Excerpt box it doesn’t do anything – I still get the entire post appearing on the home page.

    Is there something I have to do to get the excerpts to work?

    Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • use <?php the_excerpt(); ?> function

    Open your index.php or home.php, whichever you have, and replace content() with the_excerpt().

    Make sure to back up your file first, in case you mess it up. Things happen.

    Thread Starter dcloud

    (@dcloud)

    Thanks for the replies, but I’m unclear on both. First, where do I put <?php the_excerpt(); ?> in my code files? Second, I have nothing for “content()” on my index.php files.

    replace the_content() function with the_excerpt() function in your index.php or can you give your home page file?

    Thread Starter dcloud

    (@dcloud)

    Sorry, the home page of the site I’m working on is: https://hide-e-hole.com/

    There is no “the_content()” anywhere in the index.php file. I did find <?php the_content(); ?> in the loop.php file. Is that the same thing?

    I replaced the_content() with the_excerpt in my loop.php file right below the <div class=”entry-content”> line. (actually, I just added <?php the_excerpt(); ?> and then commented out the_content() by adding two forward slashes // right between the <? and the_content() )

    Thread Starter dcloud

    (@dcloud)

    CafeTica, thanks for that info. So how should I write it? I’m not sure how by what you said. Can you write it for me here so I can enter it correctly?

    replace the_content with the_excerpt. just write it.

    Thread Starter dcloud

    (@dcloud)

    I just tried replacing “the_content” with <?php the_excerpt(); ?> (in the loop.php) and it doesn’t change anything. I’m still getting the full post on the home page.

    And I do have a short blurb written in the Excerpt box for those posts, in case you were wondering (grin).

    Sorry I didn’t get back to you.

    Just out of curiosity, did you replace (or comment out) the_content() that is beneath the <div class=”entry-content”> line?

    The reason I ask is that there is more than one the_content() calls in the loop.php file. If you replace one of the other ones you’ll still see the full post on the front page.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to get excerpts to work?’ is closed to new replies.