Header customizations

Hi,

II recently upgraded at least 2 main versions at a time, and i wonder if old customization will work (i have strange behaviors sometimes).

  1. I was using the framework/views/global/_brand.php to customize the site logo. Still OK ?

  2. I was also hooking on wp_nav_menu_items to add special menu items, but it seems that both a desktop and a mobile menu are present in dom, so it creates an error saying i have 2 elements with same id on my page (i display twice my custom menu item…) is there a way to distinguish desktop from mobile menu, in order to change id selector in desktop or mobile case ? Here is the error i see in my console with duplicate ids:

Thanks a lot

Hi There,

Thanks for writing in! X/Pro themes designed to function with back-word compatibility. So if you have overwrite your files in any of the following ways will work exactly the same.

For example:
x-child/framework/views/global/_brand.php
x-child/framework/legacy/cranium/headers/views/global/_brand.php

We cannot provide support for custom development as it would be outside the scope of the support. However if you want to check how the current desktop and mobile menu works, you can check the following file on the following path.
x/framework/legacy/cranium/headers/views/global/_nav-primary.php
Relevant function file can be located under:
x/framework/legacy/cranium/headers/functions/navbar.php

Thanks!

Ok thanks, si i can keep the _brand.php file in my chile theme.
What about the recommended way to add items to navigation menu using hooks ? Is there a similar file in templates ?
thanks!

Hi there,

You could either add new menus items in Appearance > Menus or if you want to use a filter, you can use wp_nav_menu_items.

You can find more information here:

Hope this helps.

1 Like

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