Breadcrumbs show page titles but not post titles

#283248
  • Resolved Jon Wright
    Rank Math free

    Hi – I have read this support ticket but it’s not quite what I want. I would like for breadcrumbs to show page titles when on a page but not show post titles when on a post. Hope that makes sense.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Jon Wright
    Rank Math free

    It’s ok, I worked it out. Code is below for anyone else that needs it.

    <?php
    
    // Add Rankmath PHP below
    	
    	add_filter( 'rank_math/frontend/breadcrumb/settings', function( $settings ) {
    global $post;
    		
    		if ( is_single() )
    		{
    	$settings = array(
    		'remove_title'   => true,
    	);
    	return $settings;
    }});
    Prabhat
    Rank Math agency

    Hello,

    We’re glad that you got that sorted and thank you for sharing the fix.

    Please feel free to get in touch if you require any further assistance.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The ticket ‘Breadcrumbs show page titles but not post titles’ is closed to new replies.