0
votes

I am creating a single page wordpress site. The primary menu that is in header.php uses hash links to reference content in the page. All the content in the body of the webpage loads into page-home.php. One of the items in my primary menu however is Blog. Blog loads entirely different templates. Once you are in blog, the other menu items do not work because the hash links no longer have the content in the index.php templates to connect to. Should I conditionally load a separate menu for when the url is /blog/? Call a separate header on index.php?

1

1 Answers

0
votes

No need for two header.php files. Inside your current header.php use this code

<?php
     if(is_page('Home'){ //or whatever your home page is called
       wp_nav_menu ( $arrayName = array( 'theme_location' => 'primary', 'container' => 'nav', 'container_class' =>  'navbar-collapse collapse', 'menu_class'    =>  'nav navbar-nav navbar-right' ) );
     } else{
        //INSERT CODE FOR BLOG MENU
       }
 ?>