Remove Sponsored String in Breadcrumbs

Question

I copied the below snippet on how to “add sponsored post prefix to post tile” from: https://www.wpbeginner.com/wp-tutorials/how-to-add-sponsored-post-prefix-to-post-title-in-wordpress/

add_filter( ‘the_title’, ‘wpb_sponsored’ );
function wpb_sponsored( $title ) {
global $post;
$sponsored_text = ‘ Sponsored Post ‘;
$sponsored = get_post_meta($post->ID, ‘sponsored’, true);
if( $sponsored == ‘true’ && in_the_loop() ){
return $sponsored_text.$title;
}
return $title;
}

This above snippet is working, however, I am having this issue of the “Sponsored” string showing in the breadcrumbs. Can anyone assist with a solution not to show the “Sponsored” string in the breadcrumbs but only on the Post Title?

One of the URL’s I am referring to is this: https://africanminingmarket.com/another-top-research-ranking-for-wits-mining-school/3709/

Your help will be appreciated.

Thanks

0
, , LM20 4 years 2020-05-21T13:10:25-05:00 0 Answers 91 views 0

Leave an answer

Browse
Browse