Custom Breadcrumb Need

#859794
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    We apologize for the issue you are facing with creating custom breadcrumbs in WordPress. To achieve the breadcrumb structure you desire, where the breadcrumbs reflect the URL slugs instead of the post titles, you can use a filter in your theme’s functions.php file.

    Here’s a general approach you can take:

    1. Navigate to Theme File Editor: Go to WordPress Dashboard → Appearance → Theme File Editor.
      Navigate to Theme File Editor from Appearances

    2. Add Custom Code: You can add a custom function to modify the breadcrumb output. Here’s an example of how you might do this:

      add_filter( 'rank_math/breadcrumbs/items', function( $items ) {
         foreach ( $items as &$item ) {
             // Change the title to the slug
             $item['title'] = get_post_field( 'post_name', $item['id'] );
         }
         return $items;
      });

      This code snippet will replace the breadcrumb titles with the corresponding slugs.

    3. Update Your Theme: After adding the code, make sure to save your changes.

    4. Test Your Breadcrumbs: Visit your site to see if the breadcrumbs now display as desired.

    If you have numerous posts and want to apply this change in bulk, using a filter like the one above is a good approach. If you need further assistance or have specific requirements, please reply to this ticket, and a human agent from the Rank Math Support team will be happy to help you further.

    Thank you for raising this concern!

    Sources:
    How to Fix "Either ‘name’ or ‘item.name’ should be specified" Error » Rank Math

    Unfortunately it didn’t work. I guess I didn’t explain it properly. I tried to explain it with a screenshot.

    Here is SS link: https://imgur.com/a/iVawUhz

    Hello,

    Thank you for contacting Rank Math support.

    We are unable to access the page.

    Please reach out to your host to resolve this so we can check.

    We look forward to hearing from you.

    Hello,

    Thank you for your patience.

    You can change the title shown on the breadcrumbs per post under the Advanced tab:
    https://rankmath.com/kb/advanced-tab/

    However, the breadcrumbs are already showing properly as you have illustrated in your screenshot.

    bread

    Could you please confirm the exact breadcrumbs you wanted to show?

    Looking forward to helping 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 5 replies - 1 through 5 (of 5 total)

The ticket ‘Custom Breadcrumb Need’ is closed to new replies.