Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1439201

    Hello,

    We are working on creating a new website using the Agency – Enfold Parallax Demo, and we came across an issue that we can’t find a solution. We are creating the main menu and providing in the links the #{and the id of the section}, so far so good. The problem comes when the user clicks on a button to change the page, then the menu is becoming not functional because the urls (Section IDs) are not present in the specific page.

    Please advise.

    Best,
    Androklis

    • This topic was modified 7 months, 2 weeks ago by androklis.
    #1439239

    Hey androklis,
    Try creating a second menu that has the full menu item url back to the homepage and use that menu on the other pages and use the menu with just the hash tags on the homepage.
    Then use this filter in your child theme functions.php to display the different menus:

    add_filter( 'wp_nav_menu_args', 'home_nav_menu_args' );
    function home_nav_menu_args( $args = '' ) {
    if($args['theme_location'] === 'avia') {
    if( is_page( 627 ) ) {
    $args['menu'] = '25';
    }
    return $args;
    }
    }
    
    add_filter( 'wp_nav_menu_args', 'other_nav_menu_args' );
    function other_nav_menu_args( $args = '' ) {
    if($args['theme_location'] === 'avia') {
    if( is_page( 3 ) ) {
    $args['menu'] = '24';
    }
    return $args;
    }
    }

    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.

    Best regards,
    Mike

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.