newkind
Member
Posted 3 weeks ago #
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="http://google.com/image.jpg" alt="" />
<?php } ?>
?? Maybe there's other way ?
That seems reasonable. Are you looking for faster code or some other function that would do the same thing?
newkind
Member
Posted 3 weeks ago #
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) ) {