Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1302449

    Not sure how to go about this: if I have a single-page site with anchors in the navigation, how do I add a blog that links back to the page? Currently, if you click to view a blog post, the navigation no longer works obviously due to it tied to anchors. Is there a way to work around this? Is a second menu bar for blog posts?

    #1302462

    Hey Snerp,

    Thanks for contacting us!

    You can use this plugin to display different menu on certain pages – https://wordpress.org/plugins/zen-menu-logic/. You could create another menu with full links and set it as your main menu and then on your homepage you can choose to display menu with anchor links.

    Regards,
    Yigit

    #1302470

    The plugin is outdated by 4 years, I’m going to skip it.

    You’re other suggestion I’m not sure I understand. Do you mean I need to create a full links menu as the “Enfold Child Main Menu” and another menu to be the “Enfold Child Secondary Menu” that uses the anchors? If so, how do assign each menu (one for the home, the other for the blog).

    Thanks

    #1302585

    Hi,

    Then create a new menu with full links and add following code to functions.php file of your child theme

    add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );
    
    function my_wp_nav_menu_args( $args = '' ) {
    
    if($args['theme_location'] === 'avia') 
         if( is_page( 12 ) ) { 
              $args['menu'] = 'Anchor Menu'; 
              } else { 
              $args['menu'] = 'Full Menu';
              } 
    return $args;
    }

    “Full Menu” would be the name of your new menu and “Anchor Menu” is the name of the one you used on your homepage and 12 is the page ID of your homepage

    Best regards,
    Yigit

    #1302696

    You da man! Thanks, that is a great tweak. You guys should add this to your documentation…very helpful.

    #1302715

    Hi,

    You are welcome! I will update the docs soon.

    Let us know if you have any other questions and enjoy the rest of your day :)

    Best regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Single page site with blog – navigation?’ is closed to new replies.