• Hello all, I have a bit of a weird issue. I’m modifying me theme to show the_excerpt on each single page’s sidebar. The idea is to show the excerpt if it exists, or some generic comment if it doesn’t. The code I’ve added is this:

    <?php if ($post->post_excerpt) the_excerpt(); else { ?>
    <p><?php _e('You&rsquo;re currently reading an entry written by ','hemingwayex'); the_author(); ?></p>
    <?php } ?>

    And this almost works. What happens that when there is an excerpt, instead of the actual custom excerpt I’ve written, WordPress displays the generic snippet it always does when there is no actual excerpt (ie the first 120(?) words with a “[..]” in the end.

    You can see this here: https://dbzer0.com/blog/reddit-sorta-censors-atheism

    The weirdest thing is that on a test site I have, this works as it should, with the custom excerpt displayed as it should be.

    You can see the whole source of the single.php 9and the rest if you wish) from the svn repo.

    All help appreciated.

Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Call for the_excerpt() does not display the actual excerpt’ is closed to new replies.