Support » Plugin: Breadcrumb NavXT » [Plugin: Breadcrumb NavXT] Some pages show wrong breadcumb trail

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author John Havlik


    Usually just posting what’s up is fine. I like to keep support either on my website or on these forums. Other than that, my contact information is on my website and in the Breadcrumb NavXT code. Please make sure you detail what is going on (what you are getting, what you are expecting). In this case, also let know what they items in the breadcrumb trail are (e.g. posts, categories, pages, tags, custom taxonomy terms, custom post types, etc.).

    Well, the problem is quite hard to nail down onto a probable cause. But here goes…

    WordPress 3.2.2, multisite with subdomains, running NavXt 4.1.0

    It only affects the Post post type as far as I can tell (the built in, but we have renamed it to News), anyway, on these posts the breadcrumb has this structure

    Home link > Parent Page > News Post Title

    One News post seems to over-write some other News posts as far as NavXt is concerned so that the post “Look here” has the breadcrumb

    Home > News archive > Look Here

    But the News post “What happened today” also gets the “Look here” bread crumb:

    Home > News archive > Look Here

    When it should be

    Home > News archive > What Happened Today

    Same thing with other News posts.

    Plugin Author John Havlik


    Do you have any secondary loops (recent posts widget)? If so they could be doing things incorrectly and causing the problem.

    I don’t think so. I tried to remove all other widgets on the page but it did not help.

    I found another clue to the bug. Each time a new post is published the “dominant” (bread crumb that takes over the other bread crumb) changes to some other post.

    Edit: I just found occasions where this issue is not confined to a specific post type, the “dominant” bread crumb even takes over the Page bread crumb on some pages.

    Can I send you anything like settings info, screen shots or database table rows?

    Plugin Author John Havlik


    This “dominate” breadcrumb behavior is definitely due to something incorrectly modifying the $post variable. One other thing you should try is using one of the themes WordPress ships with (and have Breadcrumb NavXT as the only active plugin), twentyeleven or twentyten should do. See if the behavior continues with one of those two themes.

    This is the modification, it has worked fine and I can’t see any bugs.

    add_action('init', 'nbr_rename_posts');
    function nbr_rename_posts() {
    	global $wp_post_types, $menu, $wp_rewrite;
    	register_post_type('post', array(
    		'label' => __('News', 'nbrpost'),
    		'labels' => array(
    			'name' => __('News', 'nbrpost'),
    			'singular_name' => _x('News', 'post type singular name', 'nbrpost'),
    			'add_new' => __('Add News', 'nbrpost'),
    			'add_new_item' => __('Create news post', 'nbrpost'),
    			'edit_item' => __('Edit news', 'nbrpost'),
    			'new_item' => __('New News', 'nbrpost'),
    			'view_item' => __('Display News', 'nbrpost'),
    			'search_items' => __('Search News', 'nbrpost'),
    			'not_found' =>  __('No News Found', 'nbrpost'),
    			'not_found_in_trash' => __('No News Found In Trash', 'nbrpost'),
    			'parent_item_colon' => '',
    			'menu_name' => __('News', 'nbrpost')
    		'public' => true,
    		'show_in_menu' => false,
    		'rewrite' => array(
    		    'slug' => 'nyheter',
    		    'with_front' => true

    Edit: Tried Twenty-eleven 1.3 and Breadcrumbs doesn’t even show up in that theme. All other widgets are visible though.

    Plugin Author John Havlik


    On the twenty-eleven theme you’ll need to add in the breadcrumb calling code, or use the Breadcrumb NavXT widget (ships with Breadcrumb NavXT).

    As for the posted code, that may not be the best way of renaming the posts post type to something more usefully, but nothing jumps out at me as being horribly wrong. I’ll have to try it on my testbed and see it I get the odd behavior with it.

    I tried placing the widget in all different spots (using content to the left) but the breadcrumbs were absent.

    Plugin Author John Havlik


    Where did you have that nbr_rename_posts code located? On my testbed it doesn’t end up changing posts to ‘News’, and does cause some funky PHP errors. BTW, have you tried running with WP_DEBUG set to true?

    It does not rename the menu items (but renames them everywhere else). To rename the menu items you need to run this code (together with the earlier) in a module:

    add_action('admin_head', 'nbr_modify_menus');
    function nbr_modify_menus() {
        global $menu;
        global $submenu;
        if ($menu[5][2] == 'edit.php') {
    	    $menu[5][0] =  __('News', 'nbrpost');
    	    $submenu['edit.php'][5][0] = __('All news', 'nbrpost');
    	    $submenu['edit.php'][10][0] = __('Create news', 'nbrpost');

    We have to run the production environment with WP_DEBUG set to false, but I have tested the install on a local server and the above code sends no errors.

    Plugin Author John Havlik


    Locally you are having the same problem? Can you try commenting out both sections of the code that renames posts to news?

    That does not help. 🙁

    I discovered something else, I can never get it to happen on the main site ( but it only happens on subsites (

    Plugin Author John Havlik


    I’m trying to reproduce this on my multisite install (3.4, I always test against WP trunk), but I’m not seeing the issue. I uncovered another minor issue regarding the link to the mainsite if that breadcrumb is shown, but that’s now fixed.

    For the Twenty Eleven theme, place the Breadcrumb NavXT widget in the “Footer 1” location. It should show up on all pages for the subsite. Try again to see if doing that and disabling all custom code (other than having Breadcrumb NavXT enabled) causes the issue to still exist.

    Are you using anything custom in your .htaccess file? I can’t actually visit single post pages when using your post renaming code.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘[Plugin: Breadcrumb NavXT] Some pages show wrong breadcumb trail’ is closed to new replies.