Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1325470

    Hello,

    I want to add a button to the menu of my site but I want this button to be independent of the menu, with the following function :

    add_filter( 'wp_nav_menu_items', 'add_logo_nav_menu', 10, 2 );
    function add_logo_nav_menu($items, $args){
    $newitems = '<li><a title="logo" href="#">LOGO</a></li>';
        $newitems .= $items;
    return $newitems;
    }

    This function usually works fine, but with Enfold it doesn’t. Do you know how to make it work on Enfold? Thanks

    • This topic was modified 3 years, 1 month ago by kelem138.
    #1325505

    Hey kelem138,

    Thank you for the inquiry.

    The filter works properly on our end — it prepends the LOGO text to the existing menu items. Did you set the menu as the Enfold Main Menu in the Appearance > Menus > Menu Settings ?

    Best regards,
    Ismael

    #1325840

    Hi,

    Thanks for your answer
    Which menu should I name as the main menu? I thought that with this code, the Logo button would be added whatever the main menu of my site… ?

    #1325853

    Hi,

    Did you set the current menu as main menu? You can set it in the Appearance > Menus panel. Look for the section that is shown in the screenshot below.

    Screenshot: https://imgur.com/QB3MTZR

    Best regards,
    Ismael

    #1325910

    The current menu on my site has to be my main menu, right? Or I don’t understand your question?

    On your screenshot the menu is: “Enfold Child Main Menu” and on my menu it says “Enfold Main Menu”.

    #1325912

    Hey,

    Yes, you should set your current menu as your main menu in Appearance > Menus.

    That is because Ismael is using a child theme. If you are not using a child theme, it should say “Enfold Main Menu” :)

    Best regards,
    Yigit

    #1325940

    I put the code in function.php of the child theme but my menu “Enfold Main Menu” is not a child menu. Can the problem come from there? And if so, do you know what I should do? Thanks

    #1325970

    Hi,

    Thank you for the update.

    Can we access the site? Please post the login details in the private field and make sure that the Appearance > Editpr panel is accessible.

    Best regards,
    Ismael

    #1326018
    This reply has been marked as private.
    #1326024

    Hey,

    I added the code to bottom of Functions.php file in Appearance > Editor, cleared cache and it worked. I attached a screenshot in private content field :)

    Also, we only provide support to our registered users. If you have any other questions or issues, please register to our support forum – https://kriesi.at/support/register/ and start new threads under Enfold sub forum :)

    Regards,
    Yigit

    #1326062

    Thank you !
    Regards

    #1326064

    Hi,

    You are welcome! Let us know if you have any other questions and enjoy your weekend :)

    Best regards,
    Yigit

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Problem Enfold / WordPress for menu’ is closed to new replies.