• I wanted to display one full post plus excerpts on the front page, and was able to do so by adding:
    <?php $i = 0; while (have_posts()) : the_post(); $i++; ?>
    to the top of the index (instead of <?php while (have_posts()) : the_post(); ?>)
    But suddenly it stopped working. So I decided to have all the front page show as excerpts, so changed
    <?php the_content(); ?> to <?php the_excerpt(); ?>
    That worked. But then I changed my mind and put it back to “content.” Now I still get only excerpts showing. Why won’t WP recognize my edits? I tried closing the browser and re-opening it, but nothing. All I get are excerpts on the front page.
    Help! Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter smartyd

    (@smartyd)

    Disregard the second part of the question (resolved).

    Why doesn’t the code
    <?php $i = 0; while (have_posts()) : the_post(); $i++; ?>
    work to truncate the remaining posts after the first post?

    Thread Starter smartyd

    (@smartyd)

    Your front page is currently showing full posts.

    Thread Starter smartyd

    (@smartyd)

    Correct. I’d like it to show one full post and then excerpts for the rest. I think it was you, esmi, who suggested the line
    <?php $i = 0; while (have_posts()) : the_post(); $i++; ?>
    as a way of doing this. It worked for a while, but now it doesn’t anymore. Did I change it in the course of editing other stuff? Do you have any clue why it doesn’t work anymore?
    Thanks

    Probably because you’re missing the second part:

    <?php $i = 0; while (have_posts()) : the_post(); $i++; ?>
    [ ...]
    <?php if($i == 1) the_content();
    else the_excerpt();?>
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP edits not recognized’ is closed to new replies.