custom code in Header

Posted in: Newspaper
Post count: 21

Hi,

What file should I override in my Newspaper child theme in order to place some custom PHP code in the Header? … (I want to have a logo and some other custom element side by side)

thanks

Post count: 35449

Hello,

If you want to edit the header in child theme you need to edit the header that you are using, for example if you are using the header style 1 you need to set in child theme in folder parts> header set the header-style-1.php http://prntscr.com/p5ioqh this file mast be take from wp-content/plugins/td-composer/legacy/Newspaper/parts/header/header-style-1.php you can check more about how to use our child theme in our documentation from here -> https://forum.tagdiv.com/the-child-theme-support-tutorial/

Also please provide some more details about what you want to achieve, maybe this can be achieve with tagDiv Cloud Library and tagDiv Composer, now you can edit the header how you want.

Thank you!

Post count: 21

Thanks for your instructions, I’ll take a look and let you know how it goes.

What I’m trying to do is implement a AdRotate ads in Header instead of Theme native ones, I’ve tried and succeeded using a workaround:
– Imported Header Template 1 (Magazine theme) via Cloud Template
– deleted Ad Element
– replaced it with sidebar Element
– and inserted AdRotate Widget in it’s place (instead of PHP code)

It actually worked and displayed ads properly.

But here is the issue with this new (imported) header – and my sec. Question

I now have two headers – one for homepage (this new imported one – Template 1) and other one for inside pages (the theme default one). I have removed ad element from both – so that does not impact this test (and deactivated unsupported plugin).

They are behaving differently when loading – please check this video (tagDiv Speed Booster and WP Super Cache are turned off).

You can see it in this video – LINK (.MVK)

Do you know why is there this “gap bottom” under menu when header from template 1 loads? The other one loads just fine.

Post count: 35449

Hello,

For one of theme is look that you have set a border and for the other one the height is to big and is set some css to reduce the height, I can give you some more help if I can inspect/check these elements on your website.

Thank you!

Post count: 21

It would be great if you could take a look at this. I can’t find any setting in templates (TD Composer) that would regulate this. I found one class that is loading at the beginning when page starts:

– td-pb-span12

and it’s “pushing” elements lower, but it’s not the only one and I can’t find why these classes are loading at all.

I’ve created login credentials (admin) for you – how can I send them to you?

Post count: 35449

Hello,

You can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.

Thanks

Post count: 21

Thanks for helping out.

I have two more questions regarding the header:
– how can I set background color for upper line in the header (see image 1)
– I did not set sticky menu on, but it still appears. How can I disable it? (image 2 and image 3)

Post count: 35449

Hello,

In order to change the background color for the top bar you’ll need to change the background color from Theme panel> Theme colors> Top menu -> http://prntscr.com/pa4nif

Please notice that this option -> http://varna-starost.si/slike-za-zemljevid/image-3.png is only to show the sticky menu in tagDiv Composer.
If you want to remove/hide the sticky menu, you need to edit the header template with tagDiv Composer, click on the sticky menu, click on the css tab -> https://www.screencast.com/t/T3TJ2hvJlD and check the display option, set it on hidden -> https://www.screencast.com/t/D57O79FFainD save the template and clear all cache ( also you need to set this option per each device).
If you are not using a cloud header make sure that these option are set on disable -> http://prntscr.com/p44m35

Thank you!

Post count: 21

thanks, I’ve manage to fix all but the background colour in the heater top menu. I’ve tried and changed the settings in Theme panel > Theme Colors > Top menu like you suggested here but it remains black.

Post count: 35449

Hello,

Please make sure that you clear all cache, also if you have a header template from tagDiv Cloud Library, then you’ll need to edit that template with tagDiv Composer and header manager to change the background color on top bar.

Thank you!

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.