WordPress.org

Ready to get started?Download WordPress

Forums

Conditions of Excerpt and More tags (3 posts)

  1. JonathanCutrell
    Member
    Posted 5 years ago #

    Pretty simple; I just want to set the excerpt to show only if I enter in an excerpt to show; I hate the fact that the excerpts that wordpress makes don't include pictures or links.

    What is the php to make that possible?

    In english,

    if there is an excerpt, show the excerpt. If there isnt' an excerpt, show the content before the more tag. If there isn't a more tag, just show the content as is.

  2. churchthemer
    Member
    Posted 5 years ago #

    You might like advanced excerpt which allows you to change the length of excerpts and control what tags remain in the excerpt (like image tags).

    As for your original question something like this should work:

    <?php
    if($post->post_excerpt){
      the_excerpt();
    else{
      the_content();
    }
    ?>
  3. f1f
    Member
    Posted 5 years ago #

    That code didn't work for me but this one did: http://wordpress.org/support/topic/149280

Topic Closed

This topic has been closed to new replies.

About this Topic