Site logo

Archived topic

Combine header and site/content container

3 replies · Started by webintas on November 4, 2022

Viewing posts 1–4 of 4

Hi there,

I want to make a gradient background on the main area including the header and the content area. However, in order to do I need to have these two HTML-elements combined into one so I can apply the CSS to one element. Can I achieve that?

Hi there,

what about adding it to the body - does that not achieve what you need ?

If not you can wrap them using Hooks, try this PHP snippet:


add_action('generate_before_header', function(){
    echo '<div class="site-wrapper">';
},9);

add_action('generate_before_footer', function(){
    echo '</div>';
},1);

Hi David,

Thank you!

No, adding it to the body does not give the same. Doing that, some of the gradient background is hidden by the nav and the site footer.

Glad to be of help!

This archived topic is closed to new replies.