Check if Post has Read More

Adjust your post feed according to which Posts are using Read More tags.

if( strpos( $post->post_content, '<!--more-->' ) ) {
       the_content();
}
    else {
       the_excerpt();
}

Sourced here.

Here’s an example checking for the_post_thumbnail and Read More:

<?php if(has_post_thumbnail()) { // content with image ?> 
	<div class="whats_thumb">
		<?php the_post_thumbnail('medium'); ?>
	</div>
	<div class="whats_content">
		
	</div>
<?php } else if( strpos( $post->post_content, '<!--more-->' ) ) { // content with read more ?>
	
	<div><?php global $more; $more = 0; the_content('Read More'); ?></div>
	
<?php } else { 
	
	// content without image or read more
	
} ?>


Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.