WordPress.org

Ready to get started?Download WordPress

Forums

if excerpt else content (4 posts)

  1. Questin
    Member
    Posted 9 years ago #

    I'm trying to replace the_content() in the loop with something like this:

    If the _excerpt() is empty, show the_content()
    else show the_excerpt()

    Can you translate this for me in PHP language?

    Thank you!
    Tonyz

  2. Kafkaesqui

    Posted 9 years ago #

    <?php
    if(!$post->post_excerpt) {
    the_content();
    } else {
    the_excerpt();
    }
    ?>

  3. Questin
    Member
    Posted 9 years ago #

    thanks

  4. jdnsnowy
    Member
    Posted 9 years ago #

    Thanxs... That's what I wanted.!!!!!!!!!!!!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags