The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Check for more tag (3 posts)

  1. Lutz Schröer
    Posted 7 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
    Posted 7 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
    Posted 7 years ago #

    Thank you, this works fine.

Topic Closed

This topic has been closed to new replies.

About this Topic