• Hi,

    I was wondering if that’s the only way to check if post has been split using <!–more–> tag to display image.

    <?php if(strpos($post->post_content, '<!--more-->')) { ?>
    <img src="https://google.com/image.jpg" alt="" />
    <?php } ?>

    ?? Maybe there’s other way ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • That seems reasonable. Are you looking for faster code or some other function that would do the same thing?

    Thread Starter newkind

    (@newkind)

    Well i was thinking about some other function as WordPress doesn’t have included any conditional tag that would check if post was split ??

    No conditional that I know of…the function get_the_content uses this

    if ( preg_match('/<!--more(.*?)?-->/', $content, $matches) ) {

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Check if post was split’ is closed to new replies.