Adding Uber menu to topbar

I submitted a request similar to this a couple weeks ago and am just getting back to the issue. I am trying to add an Uber Menu to the topbar of my site. I have copied the shortcode in the header content field in the X theme options. I can see the shortcode but not the menu. The menu appears to be populating the main menu position and I have selected the menu “topbar-menu” but it does not display.

Please advise. Thank you.

https://www.leessummitdev.org/

Hello Keith,

Thanks for writing in! By default, the topbar content will only accept plain text. It will not work with shortcodes as well. To make the topbar content render any shortcode you place in it, you will need to override theme default settings with a custom function. And since what you are trying to accomplish requires a template customization, we would highly to suggest that you use a child theme.

After the child theme is set up, please add the following code in your child theme’s functions.php file

// Allow shortcodes in the topbar content
// =============================================================================
function allow_custom_shortcodes($contents) {
  $contents = do_shortcode($contents);
  return $contents;
}
add_filter('x_option_x_topbar_content', 'allow_custom_shortcodes');
// =============================================================================

We would loved to know if this has work for you.

Hey RueNel,

The addition to the functions.php file worked great for adding the menu to the topbar. The issue I have now (it was actually happening after I installed Uber menu) is the topbar menu is showing up in the primary menu location. I have deselected the “primary” location in the Uber settings but it keeps defaulting back and the box is checked. How do I make the topbar menu stop populating the primary location and let my main menu take that spot? Your help is greatly appreciated.

Hi Keith,

Thanks for writing in!

I checked your website, look like the top menu and the primary menus are different.

The primary menu populating the default menu whereas the top menu is the uber menu.
Can you please confirm if you have fixed the issue or you are pointing to something else.

Thanks

That is because I assigned the main menu in UberMenu to the footer and then just did not display it. I still do not understand how to just not have my main menu show up as an UberMenu? When I deselect the Primary and Footer options in UberMenu they just default back to Primary. I just wanted to create an UberMenu for the topbar so I have a menu solution in place that allows me to have drop down choices. Thanks in advance for your assistance.

Hello Keith,

Would you mind providing us with the admin access to your site in a Secure Note (key icon under the replies you post/posted) so that we can check your setup:

Thank you.

Hi Keith,

I have logged in to your site and I found out that you only have two set of menus. Please create at least three menus so that you can have a primary menu, footer menu and the one for your ubermenu.

Hope this helps.

I think there is some confusion. I do not understand why I need three menus to keep the Ubermenu from populating the primary position by default. I think I will just stick with the solution I have and avoid using UberMenu in the future. In my opinion there should be no auto assignment of a menu to a particular position in the template. That should be controlled by the developer and when the location assignment is selected and I unselect it…it should not default back.

Thank you for your assistance.

Hi Keith,

Since you need a different menu other than primary menu, you should have to create a new one. Also I would suggest you to check the following guide (https://sevenspark.com/docs/ubermenu-3/integration/shortcode) where your can place the shortcode with the selected menu, so it will not display the primary.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.