-
AuthorPosts
-
November 28, 2020 at 6:03 am #1263648
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,
NikoleDecember 1, 2020 at 5:55 am #1264125Hi 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,
RikardDecember 1, 2020 at 9:49 pm #1264323Thank 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!
December 3, 2020 at 4:45 am #1264619Hi,
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,
RikardDecember 4, 2020 at 3:02 am #1264917Rikard –
That worked perfectly. Thanks so much for your help! I truly appreciate it!
Best,
NikoleDecember 5, 2020 at 12:56 am #1265086Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Adding an element to a page background (boxed layout)’ is closed to new replies.
