Ignore a more tag when using get_the_content()

I would just get the raw content from $post->post_content, strip the <!--more--> and then do whatever you need with the result. Just remember, $post->post_content and get_the_content() both return unfiltered text, if you need filtered content, simply apply the the_content filter to the result from those two results

EXAMPLE inside the LOOP

global $post;
$unfiltered_content = str_replace( '<!--more-->', '', $post->post_content );
// If you need filtered content returned
$filtered_content = apply_filters( 'the_content', $unfiltered_content );
// Output filtered content
echo $filtered_content;

Leave a Comment

tech