wp_nav_menu doesn’t seem to work on custom post type pages

I’m working on something someone else set up, and on the index page, the nav appears, but on custom post type pages, it does not.

The nav menu:

 wp_nav_menu([
                'menu'              => 'Primary Menu',
                'theme_location'    => 'primary',
                'depth'             => 3,
                'container'         => 'div',
                'container_class'   => 'a',
                'container_id'      => 'b',
                'menu_class'        => 'nav navbar-nav',
                'fallback_cb'       => 'wp_bootstrap_navwalker::fallback',
                'walker'            => new wp_bootstrap_navwalker()
        ]);

I’ve seen it suggested that I place this in a function and use an if statement to do something and on other pages, have this nav function. My problem is that I don’t know what to put in the wp_nav_menu() for the custom post type pages, so it appears.

The URL for instance looks like: http://domain.com/product-category/thing/

Read more here: wp_nav_menu doesn’t seem to work on custom post type pages

Leave a Reply

Your email address will not be published. Required fields are marked *