How can you customize links in breadcrumbs?

Community Forums Forums Design Tips and Tricks How can you customize links in breadcrumbs?

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  braddalton 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #68498

    thoughtwell
    Participant
    Post count: 12

    I’m trying to avoid using plugins for this. I know it would probably be easier, but the less plugins I have to use when I build my own custom themes, the better.

    Here goes:

    Does anyone know where to look or start in changing the breadcrumbs to navigate to the parent taxonomy archive page vs. the archive page for the entire custom post type?

    What I mean is that my breadcrumbs fail to show the immediate parent when viewing a single-custom_post_type.php page. The ideal parent would be the taxonomy archive page, but instead the breadcrumb parent-level for the individual custom post type pages (single-custom_post_type.php) is showing the general custom post type rather than the taxonomy. This takes the user back to a huge pool of this custom post type vs. taking them one level up back to the taxonomy family for that post type.

    For instance, let’s say I have a custom post type of ‘Sporting Equipment.’

    Under ‘Equipment,’ I’m using 3 taxonomies to effectively categorize this custom post type. Those taxonomies would be something along the lines of Baseball, Football and Soccer.

    In my breadcrumbs, on my taxonomy archive for one of the lines of equipment such as ‘Football,’ reads:

    home / football

    So far, so good. Now let’s say I have a piece of football equipment such as ‘mouth guard.’

    On the single-custom_post_type.php page for ‘mouth guard,’ my breadcrumb reads:

    home / equipment / mouth guard

    My dilemma is that I would really like it to read:

    home / football / mouth guard

    … because I don’t want to redirect users back to an ‘equipment’ archive where all of the taxonomies are mixed together in a huge pool.

    HELP!!!!

    http://local
    #68501

    braddalton
    Participant
    Post count: 7473
    #68684

    thoughtwell
    Participant
    Post count: 12

    Thanks, Brad. The post on your blog was very informative. Changing the labels seems pretty straightforward, as explained.

    Where I’m having trouble is actual default functionality of the breadcrumbs omitting the hierarchal taxonomy of the custom post type and pointing to the entire custom post type archive.

    I notice in your post, there is an argument for hierarchal categories that points to ‘true’ which is maybe somewhat in the vein of what I’m looking for… but since the custom post type uses taxonomies rather than categories to organize the individual custom post types, I take it this argument is having no effect towards pointing the page level up to the taxonomy archive rather than the custom post type archive.

    I guess I just need to figure out how to add in this functionality for taxonomies as well as categories if this is along the lines of what I should be looking at.

    #68705

    braddalton
    Participant
    Post count: 7473

    Yes its not something i have really spent much time on so i’m not an expert on this topic but i am interested in what you come up.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.