Breadcrumbs not showing

#675873
  • Hello, thanks. I enabled breadcrumbs through Rankmath but they are not showing on my site, . I also added the code it suggested to my functions.php but that also didn’t work. How can I get them showing?

Viewing 6 replies - 16 through 21 (of 21 total)
  • Hello,

    This code my colleague shared shouldn’t be added to the header.php file. You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    As for the other custom post type you mentioned. Can you please share some example post URL so we can come up with a new code?

    Looking forward to helping you.

    Thanks a lot! May I know where you have added this code? As I don’t see it in the header.php and I liked to replicate it for other custom posts that such as Job Descriptions.

    Hello,

    Looks like you didn’t see our previous reply. The code we added was via a plugin called Code Snippets and you can see the code in your WordPress Dashboard > Snippets. The name of the snippet is “Add Archive to Rank Math breadcrumbs”

    You can add subsequent using this same method, from Snippets > Add new. You can also see other methods to add the code to your site here: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    We hope this helps you resolve the issue. If you have any other questions or concerns regarding Rank Math, please feel free to contact us again. We are always happy to help.

    Thank you for choosing Rank Math!

    Thank you!

    Here is the example URL of the job descriptions post type:

    https://nurserecruitmentx.com/job-descriptions/acute-care-nurse/

    Hello,

    For the post type you share, you can use this code:

    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
            //Adding to single posts
    	if(is_singular('job-descriptions')){ // change to match the actual post type
                    $value[] = array(
    		        'Job Descriptions', 
                    'https://nurserecruitmentx.com/job-descriptions/', 
                    'hide_in_schema' => false
    		);
                    //add this value as the second item in array
    		array_splice( $crumbs, 1, 0, $value ); 
    		return $crumbs; 
    	}
    	return $crumbs;
    }, 10, 2);

    For subsequent post types, you can modify is_singular to match the custom post type slug, i.e. is_singular('custom-post-type'), then you change the content of the $value array to match the new custom post type, i.e:

    array(
    		        'Custom Post Type', 
                    'https://nurserecruitmentx.com/custom-post-type/', 
                    'hide_in_schema' => false
    		);

    And that’s it. We hope this helps you resolve the issue. If you have any other questions or concerns regarding Rank Math, please feel free to contact us again. We are always happy to help.

    Thank you for choosing Rank Math!

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 6 replies - 16 through 21 (of 21 total)

The ticket ‘Breadcrumbs not showing’ is closed to new replies.