WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Check for more tag (3 posts)

  1. Lutz Schröer
    Member
    Posted 5 years ago #

    I want to check if a post contains the <!-- more --> tag. At the moment I'm using a quite dissatisfying solution:

    if (strpos(get_the_content('^&amp;^&amp;'), '^&amp;^&amp;') > 0)

    since I have to retrieve the post from the DB again. Isn't there any function or global variable indicating that the post uses the more tag?

  2. MichaelH
    Member
    Posted 5 years ago #

    Should be able to use something like this if in a post loop
    $pos=strpos($post->post_content, '<!--more-->');

    ;( stupid forum still mangling ampersands

  3. Lutz Schröer
    Member
    Posted 5 years ago #

    Thank you, this works fine.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags