• ollym

    (@ollym)


    I want to make more use of excerpts in my bloggyness. BUt i need some PHP help.

    I want to mod the index page so that IF an article has an excerpt then call the_excerpt(), but IF the article has doesnt have an excerpt, then call the_content()

    Can this be done? If so, how ?

    Olly

Viewing 1 replies (of 1 total)
  • ColdForged

    (@coldforged)

    I do something similar but opposite for my blog (display content if it exists, otherwise excerpt). Try this within The Loop:

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

Viewing 1 replies (of 1 total)
  • The topic ‘A bit of php help’ is closed to new replies.