I want to create a bredcump with post relationship

#691374
  • Resolved Dani Santos
    Rank Math free

    Good team,

    I want to create a breadcrumb for custom blog posts.

    1- I will create a field to be called: Entry to relate with a url capo to relate with ur.

    2- I want when creating this custom field the breadcrumbs to be: Home > “custom field” > Title of the current entry.

    The objective is to be able to relate in the breadcrumbs a superior entry to the one we are in, but they are not categories but entries.

    Thank you very much ๐Ÿ˜€

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Thank you for reaching out to us with your query about creating custom breadcrumbs for your blog posts.

    To achieve the breadcrumb structure you’ve described, you can use Rank Math’s built-in features to customize the breadcrumbs. You can create a custom field and then configure the breadcrumbs to display the custom field and the post title.

    Here’s a step-by-step guide to achieve this:

    1. Create a custom field called “Entry” to relate with a URL capo.
    2. Configure the breadcrumbs to display “Home > Custom Field > Title of the Current Entry.”

    To set up the custom field and configure the breadcrumbs, you can follow these steps:

    • Create a custom field in your WordPress post editor using a plugin like Advanced Custom Fields or any other custom fields plugin.
    • Once the custom field is created, you can use Rank Math’s built-in settings to customize the breadcrumbs. You can configure the breadcrumbs to include the custom field and the post title.

    If you need further assistance with setting up the custom field or configuring the breadcrumbs, please feel free to reply to this ticket, and our support team will be happy to assist you further.

    I hope this helps! If you have any more questions or need further assistance, please don’t hesitate to ask.

    Sources:
    How to Enable Breadcrumbs on Your Website With Rank Math SEO ยป Rank Math
    Rank Math General Settings

    Dani Santos
    Rank Math free

    I have created the custom field, but what steps do I follow to modify the breadcrumb structure?

    Dani Santos
    Rank Math free

    I have created the custom field, but what steps do I follow to modify the breadcrumb structure?

    Hello,

    Apologies for the delay as we currently have a high volume of tickets here in our support forums.

    To insert the field in Rank Math breadcrumbs, you may use and customize this filter on your site:

    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
            //Adding to single posts
    	if(is_singular('post')){ // change to match the actual post type of the entry
                    $value[] = array(
    		'My custom field', //change to the name shown on the breadcrumbs 
                    'https://www.domain.com/my-field', //change this to the actual URL 
                    '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);

    Here is a guide you can follow to add the filter:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps.

    Thank you.

    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 4 replies - 1 through 4 (of 4 total)

The ticket ‘I want to create a bredcump with post relationship’ is closed to new replies.