Content Above Topbar or Masthead

Hi, I’ve read every article you have and nothing works. I want to add a custom 2-column row above the masthead in place of your standard topbar. The topbar only accepts HTML. Adding the custom function snippet that allows for global blocks is ineffective, as it strips all DIV elements. I just want one set of information on the left, another set of information on the right, and for it to be full width stacked on mobile. I have the HTML and CSS already to achieve it. I just don’t know what the function is that would enable me to insert it. I would then disable the topbar after insert as it would take it’s place.

i’ve tried using the header builder, but it’s too complicated. I don’t know why it wouldn’t have the same UI and labels as the standard page builder. but either way, I can’t use the header builder because it doesn’t allow for megamenus.

I just need a way to add a custom topbar, or custom content area, where the topbar usually resides.

trying to add all the left content to usatcorp.com.

To have it mirror callm.com (which uses a different theme and megamenu plugin that I don’t want to have to install on usatcorp.com to achieve the same effect).

Hello Jesse,

Thanks for writing in!

You can use this one:
add_action('x_after_masthead_begin', 'add_my_custom_content')

The custom content will be display before the topbar or any other content you have created in the header.

Kindly let us know how it goes.

That action cause a critical error.

Hey Jesse,

Before I point you to the right direction, please note that we do not provide support for custom code. We’re sorry this wasn’t made clear.

I see you are already using Pro so you have a Header builder. Please use the Header Builder if you need a header design not offered by the Original Header.

If you wish to continue with custom code or you need theme customization guidance through custom code, please subscribe to our One premium support.


The code provided by Ruenel has a syntax error. There should be a semi-colon at the end of the code.

image

If adding a semicolon doesn’t fix the issue and you want to continue with the custom code approach, please subscribe to our One premium support.

Thanks.

The header builder doesn’t support megamenu functionality and is therefore unsuitable for my purposes. Fixing the syntax error prevented the site from crashing with the new script, but the script failed to populate any results from the code. So that’s probably not the right action. I just need the right action for it to work.

Hey Jesse,

x_after_site_begin is the hook you need. The code provided by Runel works if you use the Header Builder.

image

By the way, Mega Menu elements are available in Pro. See https://youtu.be/zgAMBLRxG_w

The code is tested on my site and it works. If it still won’t work on your end, you need to subscribe to our One premium support. It would be unfair for our One subscribers if we provide continued customization guidance here as part of theme support.

Thank you for your understanding.

The mega menu is only available as a modal. If it was available as text, i could simply build a menu for each of my top-level pages that had a dropdown with their child pages, but as the megamenu is only a modal, it cannot serve my purposes. I’ll try your hook and see what happens. Though if there is a way to have a traditional menu, with megastyle dropdowns, that is exactly what I need.

Understood, Jesse.

OK, I figured out how to use the modal while still having the primary nav appear as inline navigation. I was able to make use of the megamenu modal. I just built independent menus for each navbar topic. Came out pretty decent.

Awesome Jesse.
Please feel free to create another thread if you need any further information.

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