Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #27022

    To start, my WordPress permalink structure is set up like this (pretty standard):

    http://www.domain.com/%postname%/

    (same thing as choosing the “Post Name” option within Settings -> Permalinks)

    In my blog section (called “News”), I have a post at the URL. http://www.domain.com/post-title

    Right now the breadcrumb on the post page is displaying like this:

    “You are here: Home » News » Press » News » [post-title]”

    “Reviews” and “Press” are Post categories for the post. I don’t want any of the categories to be displayed within the breadcrumb. It should just read:

    “You are here: Home » News » [post-title]”

    How do I modify or fix this?

    Thanks!!

    #132485

    Hi,

    Edit framework > php > class-breadcrumb.php, find this code on line 283:

    if('post' == $post_type)
    {
    $category = get_the_category();
    $ID = $category[0]->cat_ID;

    $parents = get_category_parents($ID, TRUE, '$$$', FALSE );
    $parents = explode("$$$", $parents);
    foreach ($parents as $parent_item)
    {
    if($parent_item) $trail[] = $parent_item;
    }
    }

    Remove it.

    Regards,

    Ismael

    #132486

    Will this edit be overwritten if the theme is ever updated?

    #132487

    Okay I tried this and it’s very close, but the structure I’m getting now is:

    You are here: Home » News » News » [post title]

    With a double “News” within the breadcrumb. Any suggestions?

    #132488

    Can you post a link to the page where the breadcrumb doesn’t display right? Ismaels code modification should remove all category links and I checked the blog posts (eg http://pco.lachela.com/reviews-press-from-video-games-live-concert/ ) and the breadcrumb seems to be correct with

    You are here: Home » News » Reviews & Press from Video Games Live Concert

    #132489

    Hi Dude,

    I attempted to fix the problem myself, but I ended up messing up the structure of the breadcrumbs on all the pages (but fixed the problem with the blog posts). I have reverted back to the original class-breadcrumbs.php along with your suggested update from above and now you can see that it isn’t working correctly when viewing a single blog post (still getting the double “News > News”) category within the breadcrumb. But now the pages are working correctly. You can take a look here: http://www.pcomusic.org/video-games-live-at-comic-con/

    #132490

    Hey,

    Please add this on your custom.css or Quick CSS to hide the duplicated link on single posts.

    .single .breadcrumb-trail a:nth-child(4) {
    display: none;
    }

    .single .breadcrumb-trail span.sep:nth-child(3) {
    display: none;
    }

    Regards,

    Ismael

    #132491

    That works! Thank you.

    #132492

    Hey,

    Glad it worked. This is a temporary solution, I’m not sure if you will encounter any issues on the future.

    Regards,

    Ismael

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

The topic ‘Breadcrumbs not respecting permalink structure’ is closed to new replies.