Tagged: breadcrumbs
-
AuthorPosts
-
January 16, 2022 at 10:32 am #1335737
Hello,
I have an issue that the breadcrumbs are not in the correct order. A blog post shows:
blog category – main blog – blog postIt should be:
main blog – blog category – blog postSee below link for reference
January 16, 2022 at 10:17 pm #1335780Hey Matthew,
Thank you for your patience and the link to your site, I’m not sure why this has occurred but I couldn’t recreate it on my demo site and your other pages seem to be correct, so assuming that this is the only page with the issue I came up with this script to correct.
Try adding this code to the end of your functions.php file in Appearance ▸ Editor:function custom_script() { ?> <script> (function($){ var temp = $("#top.postid-70154 .breadcrumb-trail span:nth-child(2)").html(); $("#top.postid-70154 .breadcrumb-trail span:nth-child(2)").html($("#top.postid-70154 .breadcrumb-trail span:nth-child(4)").html()); $("#top.postid-70154 .breadcrumb-trail span:nth-child(4)").html(temp); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
Best regards,
MikeJanuary 17, 2022 at 7:43 pm #1335917I found the issue. I added this code to the functions.php tp remove the home link. It did remove the home link but then it changed the order to put the blog category before the blog link.
// Remove home from breadcrumbs
add_filter(‘avia_breadcrumbs_args’, ‘avia_change_home_breadcrumb’, 10, 1);
function avia_change_home_breadcrumb($args){
$args[‘show_home’] = false;
return $args;
}January 17, 2022 at 11:43 pm #1335924Hi,
Glad to hear that you have this sorted out, I see you are using this css to hide the “You are here:” from the breadcrumbs.breadcrumb-trail .trail-before { display: none; }
If you also want to hide the “Home” and the first backslash try this css:
#main .breadcrumb-trail > span:nth-child(2), #main .breadcrumb-trail > span:nth-child(3){ display: none; }
After applying the css, please clear your browser cache and check.
Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.