Hello! I am wondering if it is possible to add an element that spans the width of the page while preserving the boxed layout.
I am rebuilding a site that has an element I can’t seem to reproduce with the Enfold theme. The original site has a div running the width of the site aligned with the header and menu. I am able to grab the CSS from the original site, but I can’t seem to figure out what to attach it to to create the effect.
Original site and dev site linked in private content.
Thank you SO much for your help.
Best,
Nikole
Hi Nikole,
Sorry for the late reply. It’s a div which you can try to add to header.php in your child theme for example:
<div class="background-strap"></div>
Then add this to your Quick CSS:
.background-strap {
background-color: #b5006c;
border-top: 1px #95005c solid;
border-bottom: 1px #742152 solid;
height: 67px;
z-index: -10;
position: absolute;
top: 69px;
width: 100%;
}
Best regards,
Rikard
Thank you, Rikard! Is there any additional code I need to enter in the header.php file to create the class?
I was attempting to use a plugin to add the code (research showed this was the safest way to do this) and I’m getting an error message, so I feel I must be missing something? Is there some additional php language I need to include?
Thank you so much!
Hi,
You can use a function in functions.php to add it if you like:
function add_strap_div() {
echo '<div class="background-strap"></div>';
}
add_filter( 'wp_body_open', 'add_strap_div' );
Best regards,
Rikard
Rikard –
That worked perfectly. Thanks so much for your help! I truly appreciate it!
Best,
Nikole
Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon