Snippets: Display Read-More Button For Blog Posts With The Read-More Tag Only


function my_readmore_edits( $bool ) {
	global $post;
	// Check for read-more tag
	if ( strpos( $post->post_content, '<!--more-->' ) !== false ) {
		$bool = true;
	} else {
		$bool = false;
	}
	return $bool;
}
add_filter( 'wpex_has_readmore', 'my_readmore_edits' );

Snippet Type: PHP

Posted Under: Blog

All PHP snippets should be added via a child theme's functions.php file.