Community Forums › Forums › General Genesis Framework Discussions › Remove wrap from site header
Tagged: wrap div genesis outreach pro
- This topic has 5 replies, 4 voices, and was last updated 1 year, 10 months ago by
fasf12f.
-
AuthorPosts
-
April 12, 2023 at 11:19 am #507262
provopeople
ParticipantHi I'm using the current version of Genesis and WordPress but an old Outreach Pro theme from StudioPress.
I for the life of me can't figure out where the "class=wrap" is coming from in my site header. If anyone can point me to where this is, I will be very appreciative!
Here's the HTML my site is generating, you can see the div being marked as "wrap" in the highlighted line: https://imgur.com/a/95QtEsF
We're working on a new site but for now we want the "wrap" taken our of the header so it's full width.
Thanks for any help!
https://vkl859bf01j.c.updraftclone.comApril 13, 2023 at 7:13 am #507276alexhailer
ParticipantOk
April 13, 2023 at 7:16 am #507277alexhailer
ParticipantWe provide concrete contractors in Fairfield CT, I have not a lot of knowledge but it can be help you:
It seems like the "class=wrap" is being generated by your Outreach Pro theme's header code.To remove the "wrap" class and make the header full width, you will need to modify the theme's code.
Here are the steps you can follow:
Go to your WordPress dashboard and navigate to Appearance > Editor.
On the right-hand side, you should see a list of theme files. Look for header.php and click on it to open the file.
Look for the div tag that wraps around the header content, which should have the "wrap" class. It may look something like this:
php
Copy code
<div class="wrap">
<header>
...
</header>
</div>
Remove the "wrap" class from the div tag, so it looks like this:
css
Copy code
<div>
<header>
...
</header>
</div>
Click on the "Update File" button to save your changes.
After making these changes, your header should now be full width. However, please note that modifying theme code can be risky and it's always a good idea to make a backup of your website before making any changes.April 13, 2023 at 2:34 pm #507282provopeople
ParticipantHey I really appreciate the answer and the detailed steps, that's very helpful.
I went in through my webhost file manager, and found the wp-content/themes/outreach-pro directory (that's our old outdated theme). I looked at header.php.
The closest thing I found was a call to genesis_structural_wrap( 'site-inner' ); in the header.php, at the end. I did comment that out but that only affects the content area of the site, not the header.
I had looked there before and several other places, in fact I have done a grep for "wrap" in my theme dir and the parent theme dir, recursively.
All I found there was add_theme_support( 'genesis-structural-wraps' )
I find a million references to wrap in my CSS and I suppose I could attack it that way.
May 8, 2023 at 11:37 pm #507387rachelgomez123
ParticipantIt looks like the "wrap" class is being added to the header container div by the genesis_do_header() function, which is part of the Genesis Framework. This function is located in the lib/structure/header.php file of the Genesis Framework.
However, modifying core files of the Genesis Framework is generally not recommended, as it can cause issues with updates and compatibility with other plugins and themes.
A better approach would be to create a child theme and modify the header template to remove the "wrap" class. Here are the steps to do so:
Create a new folder in your WordPress /wp-content/themes/ directory and name it something like outreach-pro-child.
Create a new style.css file in the outreach-pro-child folder and add the following code to it:
arduino
Copy code
/*
Theme Name: Outreach Pro Child
Template: outreach-pro
*/
This code tells WordPress that this is a child theme of the Outreach Pro theme.Create a new functions.php file in the outreach-pro-child folder and add the following code to it:
php
Copy code
<?php
add_action( 'genesis_before', 'remove_wrap_class' );
function remove_wrap_class() {
remove_action( 'genesis_header', 'genesis_do_header' );
add_action( 'genesis_header', 'custom_do_header' );
}
function custom_do_header() {
?>
<header class="site-header" itemscope itemtype="http://schema.org/WPHeader">
<?php
do_action( 'genesis_site_title' );
do_action( 'genesis_site_description' );
genesis_do_nav( genesis_get_structural_wrap( 'menu-primary' ) );
?>
</header>
<?php
}
This code removes the genesis_do_header() function from the genesis_header action hook, and adds a new custom_do_header() function that outputs the header without the "wrap" class.Copy the header.php file from the Outreach Pro theme folder (/wp-content/themes/outreach-pro/) to the outreach-pro-child folder (/wp-content/themes/outreach-pro-child/).
Edit the header.php file in the outreach-pro-child folder and remove the class="wrap" attribute from the header container div.
Activate the Outreach Pro Child theme from the WordPress dashboard.
With these changes, your site header should now be full width without the "wrap" class.
Regards,
Rachel Gomez
rachelgomez
May 19, 2023 at 7:01 am #507435fasf12f
ParticipantFrom inspecting brakes and steering systems to evaluating tire conditions, they meticulously examine every aspect of a vehicle's safety features. Their vigilance can uncover issues that, if left unaddressed, could compromise the safety of both the driver and passengers. In addition to routine safety inspections, mechanics also perform critical repairs, such as fixing faulty airbag systems or replacing worn-out suspension components. Their commitment to vehicle safety contributes to reducing accidents and protecting lives on the road. We rely on the knowledge and expertise of automotive mechanics to keep our vehicles in optimal condition and ensure our safety behind the wheel. Do you need more information from a specialist? Visit us.
-
AuthorPosts
- You must be logged in to reply to this topic.