Tagged: enfold
-
AuthorPosts
-
October 18, 2021 at 6:21 pm #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.
October 19, 2021 at 4:32 am #1325505Hey 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,
IsmaelOctober 21, 2021 at 11:31 am #1325840Hi,
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… ?October 21, 2021 at 12:52 pm #1325853Hi,
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,
IsmaelOctober 21, 2021 at 4:00 pm #1325910The 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”.
October 21, 2021 at 4:09 pm #1325912Hey,
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,
YigitOctober 21, 2021 at 7:50 pm #1325940I 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
October 22, 2021 at 5:08 am #1325970Hi,
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,
IsmaelOctober 22, 2021 at 11:13 am #1326018This reply has been marked as private.October 22, 2021 at 12:01 pm #1326024Hey,
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,
YigitOctober 22, 2021 at 1:54 pm #1326062Thank you !
RegardsOctober 22, 2021 at 2:01 pm #1326064 -
AuthorPosts
- The topic ‘Problem Enfold / WordPress for menu’ is closed to new replies.