How to edit header?

Hello. I would like to edit the header of my website (www.tidessamui.com). Specifically, I would like to edit the very top header menu (screenshot). To this area I would like to add a shortcode corresponding to a particular plugin–Google Language Translator (screenshot). The shortcode should add small country flags users can click to translate the page into another language.

How would I approach this customization? I tried looking at header.php, but it contained a single line of code using some in-house X function: x_get_view( 'header', 'base' ).

Ideally I would like to do this via custom code to my child theme’s functions.php. I would like to avoid directly editing a theme file if possible.

Thanks in advance.

Hi there,

You will have to edit the _topbar.php file to edit this section as there is no available hook that you can use in the functions.php file.

You can refer to this thread from more info.

Thanks for the reply. But is _topbar.php a file I have to create, or does it already exist? Regardless, in what directory should it, or does it, reside? I looked in /public_html/tidessamui/wp-content/themes/x/framework/views/global, as the thread you linked suggests, but it was not present.

Thanks.

Hi There,

You need to re-create the directories on your child theme.

You need to copy the original file from the parent theme, make your changes and add to the folder you have created on the child theme.

Hope it clarifies.

Hope it clarifies.

Sorry, it doesn’t.

You need to copy the original file from the parent theme

I understand that. But where in the parent theme is the file located?

Thanks.

Hi There,

Sorry about that, it is located on.

\wp-content\themes\x\framework\legacy\cranium\headers\views\global

And you will need to create the path inside your child theme.

framework\legacy\cranium\headers\views\global

Place the file there and make your changes.

Hope it makes sense.

OK thanks for that. We can consider this resolved.

edit: Actually, for a future update, could I submit a request to add a filter hook to this template, so one can easily modify its contents? That might be easier said than done. But just a suggestion.

You’re welcome!

Please check this article on why we use views instead of hooks on some parts of the structure.