patric-boehner
7/11/2016 - 12:11 AM

Check for the default <!--more--> and change it but leave custom <!--more Custom Text--> alone

Check for the default and change it but leave custom alone

<?php
// don't use

/** ======================================================================================
 *
 * Read More the_content_more_link
 * Check for the default <!--more--> and change it 
 * but leave custom <!--more Custom Text--> alone
 * 
======================================================================================= */
function yourprefix_more_content_more_link( $more_link ) {

	global $post;
	
	if( strstr( $post-> post_content,'<!--more-->') ) { 
		return sprintf( '<a href="%s" class="more-link">%s</a>', get_permalink(), 'Read More' );
	} else {
		return $more_link;
	}
	
}
add_filter( 'the_content_more_link', 'yourprefix_more_content_more_link' );