Community Forums › Forums › Design Tips and Tricks › Minimum Theme: Structural Wraps
Tagged: home page, Minimum theme, structure
This topic contains 2 replies, has 3 voices, and was last updated by sandy 2 months, 2 weeks ago.
-
AuthorPosts
-
January 11, 2013 at 10:49 am #11253
Hi, I am working with the Minimum theme and have changed a few things on the home page. I’ve added two “call to action” widgets–one above the social icons and one below the social icons. The client wanted to remove the blog posts from the bottom of the home page, so I simply added:
remove_action(‘genesis_loop’, ‘minimum_grid_loop_helper’);
That removed the blog posts, but it created a large amount of whitespace below the second call to action widget and above the footer area. What I wanted to do was conditionally remove the “inner” wrap on the home page only.
I tried:
if ( is_home() ) {
/** Add support for structural wraps */
add_theme_support( ‘genesis-structural-wraps’, array(
‘header’,
‘nav’,
‘subnav’,
‘footer-widgets’,
‘footer’
) );}
else
{
/** Add support for structural wraps */
add_theme_support( ‘genesis-structural-wraps’, array(
‘header’,
‘nav’,
‘subnav’,
‘inner’,
‘footer-widgets’,
‘footer’
) );}
But it always defaults to the else. It is as though it is not recognizing the home page as the home. So my questions:
Is there a better way to conditionally remove the “inner” from the home page? If so, how?
Why is my code defaulting to the else?The site is currently located at http://72.41.80.181/
Thanks in advance for any help you can give!
Mike
January 21, 2013 at 4:37 pm #13583Mike, I don’t think this approach will work. My understanding of the structural wrap function is it will pull divs out of the wrap, but not control whether they exist or not.
This is technically not a best practice, but you can hide that div on the home page with this css:
.home .minimum #inner {
display: none
}
To be more technically correct, you would want to write code either in your functions file or your page template that removes that div, a bit more of an involved process.
Need more help? Find me on Twitter @gidgetthegeek
March 6, 2013 at 7:49 am #24534Hi There
Please check my code it will work for you .
if ( is_home() ) {
add_theme_support( ‘genesis-structural-wraps’, array(
‘header’,
‘nav’,
‘subnav’,
‘footer-widgets’,
‘footer’
) );
}elseif ( is_singular( array( ‘post’, ‘page’ ) ) && has_post_thumbnail() ){
add_theme_support( ‘genesis-structural-wraps’, array(
‘header’,
‘nav’,
‘subnav’,
‘inner’,
‘footer-widgets’,
‘footer’
) );}Regards
Sandeep
-
AuthorPosts
You must be logged in to reply to this topic.