Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am finding a very strange behavior with a WordPress main menu into this custom theme that use BootStrap: http://onofri.org/WP_BootStrap/

As you can see in the horizontal main menu the background of the voice related to the current page is red (ok, this is the right behavior)

The problem is that in the local version of the same website (use the same theme, I have uploaded it from my local web server to the previous onine web server) I have a different visualization of the menu (there is no the red brackground), here below I am attaching a picture of the local version:

enter image description here

This is the code that generate this main menu:

<!-- Header e barra di navigazione -->
        <header>

        <nav class="navbar navbar-default"" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>

                    <a class="navbar-brand" href="<?php echo home_url(); ?>">
                        <?php bloginfo('name'); ?>
                    </a>
                </div>
                <?php
                    wp_nav_menu(array(
                        'menu' => 'primary', 
                        'theme_location' => 'primary', 
                        'depth' => 2,
                        'container' => 'div', 
                        /*'container_class' => 'navbar navbar-default',*/
                        'menu_class' => 'nav navbar-nav', 
                        'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 
                        'walker' => new wp_bootstrap_navwalker())
                    );
                ?>
            </div>
        </nav>
        </header><!-- /header -->

What could be the problem? the theme is the same.

share|improve this question

1 Answer 1

The first difference I can spot from the outside is that your local first page is "Sample Page", in the online Demo it is "Home", maybe this is the difference which cause this output. Furthermore can you please provide a download link for the theme, so I can test it also locally.

share|improve this answer
    
yes it was the "problem" but I can't understand why if the first page is the "Home" voice I have the red background and if the first voice in the menu is another one I have not the red backgroud...do you have some idea about the cause of this behavior? –  AndreaNobili Jan 24 at 13:04
    
I cant find the "WP_BootStrap" theme in the theme directory or via Google neither you provide a download link, so I have to continue guessing ;) Basically the CSS selector for the red background includes an "active" class .navbar-default .navbar-nav > .active > a { background-color: #990000; } and I guess without a "Home" site set this class is missing, can you confirm? –  bassgang Jan 24 at 14:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.