WordPress.org

Ready to get started?Download WordPress

Forums

Checking for the more quicktag? (3 posts)

  1. nmallory
    Member
    Posted 8 years ago #

    Is there a way to check if a post has a <!--more--> quicktag before you call the_content()?

    For example, if I wanted to do something different with those posts that have it as opposed to those that do, how could I check?

  2. Kafkaesqui

    Posted 8 years ago #

    Try something like this:

    <?php if(strpos($post->post_content, '<!--more-->')) : ?>
    Do this if there's <!--more-->
    <?php else : ?>
    Do this if there's no <!--more-->
    <?php endif; ?>

  3. nmallory
    Member
    Posted 8 years ago #

    Thanks! This works great!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags