Community Forums › Forums › Design Tips and Tricks › Show only Generate Box and Footer widgets on Homepage
Tagged: generate
This topic contains 6 replies, has 4 voices, and was last updated by derekalvarez 3 months, 2 weeks ago.
-
AuthorPosts
-
February 6, 2013 at 2:18 pm #18493
I would like my home page to show only the generate box and the three column footer widgets . In the wordpress settings I have to choose to show blog or static page on the home page. Is there a way around this? Seee my site at http://2mmpartners.com
here is the code in my front-page.php
<?php
/** Add Generate Box after header **/
add_action( ‘genesis_after_header’, ‘generate_box’, 10 );
function generate_box() {if ( is_active_sidebar( ‘generate-box’ ) ) {
echo ‘<div id=”generate-box”><div class=”wrap”>’;
dynamic_sidebar( ‘generate-box’ );
echo ‘</div><!– end .wrap –></div><!– end #generate-box –>’;
}}
genesis();
Antonios @AntoniosHadji
2mmPartners.com * FueltheBodyWell.com-
This topic was modified 3 months, 2 weeks ago by
Antonios. Reason: clarify code block
-
This topic was modified 3 months, 2 weeks ago by
Antonios. Reason: clarify code block
February 7, 2013 at 1:55 am #18597An easy way to do this would be to install the Widget Logic plugin and add is_home() to the widget logic field which is added to all widgets.
Don’t forget you also have Generate Box plugin settings like this:
Display Settings > Enable and display Generate Box > Enable Generate Box on front page?
WordPress Developer & Consultant
Brad Dalton @ WP Sites – Click Here to Get Genesis Child Theme Tips Delivered.February 7, 2013 at 9:02 pm #18836Thanks for the response but the Generate box is fine the way it is. I’m trying to remove the front page requirement so that the only thing that shows up is the generate box and footer widgets. right now there is a page in the middle of these items that is displaying.
Antonios @AntoniosHadji
2mmPartners.com * FueltheBodyWell.comFebruary 8, 2013 at 1:33 am #18876Many ways to do this. Using CSS and display:none is the easy way but its not best practice:
.home #content{ display: none; }Here i added the generate box using php to a copy of the landing page template using a conditional tag and editing the different elements which are filtered out using the default remove action for the landing page:
/** Add Generate Box after header **/ add_action( 'genesis_after_header', 'generate_box', 10 ); function generate_box() { if ( is_page( '37533' ) ) { echo '<div id="generate-box"><div class="wrap">'; dynamic_sidebar( 'generate-box' ); echo '</div><!-- end .wrap --></div><!-- end #generate-box -->'; } } // Remove header, navigation, breadcrumbs, footer widgets, footer add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs'); genesis();.page-id-37533 #content{ display: none; }Creating a custom home.php or custom page template is better than using CSS to hide content.
WordPress Developer & Consultant
Brad Dalton @ WP Sites – Click Here to Get Genesis Child Theme Tips Delivered.February 8, 2013 at 7:41 am #18917Hi,
I’m not sure about what you are doing with the front-page.php as the Generate theme doesn’t have that file “out-of-the-box”
To accomplish what you are after with a default install, you would open home.php and delete:
add_action( 'genesis_loop', 'child_grid_loop_helper' ); /** Add support for Genesis Grid Loop **/ function child_grid_loop_helper() { if ( function_exists( 'genesis_grid_loop' ) ) { remove_action( 'genesis_before_post_content', 'generate_post_image', 5 ); genesis_grid_loop( array( 'features' => 2, 'feature_image_size' => 'featured', 'feature_image_class' => 'alignleft post-image', 'feature_content_limit' => 0, 'grid_image_size' => 'grid', 'grid_image_class' => 'alignleft post-image', 'grid_content_limit' => 0, 'more' => __( 'Continue reading...', 'genesis' ), 'posts_per_page' => 6, ) ); } else { genesis_standard_loop(); } }And then add:
.home #inner { display: none; }to your CSS file to remove the empty div
Again, this is how to do it without your custom front-page.php file.
Let me know how you make out.
Hard Boiled Greg
Website: Hard Boiled Greg Twitter: @hbgreg
February 8, 2013 at 9:42 pm #19158thanks Greg, that’s what I was looking for.
Antonios @AntoniosHadji
2mmPartners.com * FueltheBodyWell.comFebruary 21, 2013 at 1:03 pm #22029Hi Greg, what about if I want to remove the blog posts and sidebar from the home page, and instead add a full-width widget? I used this tutorial to add a home page widget…
http://my.studiopress.com/tutorials/register-widget-area/
…but I’m struggling with what code I should add to the home.php file.
Website url is…
-
This topic was modified 3 months, 2 weeks ago by
-
AuthorPosts
You must be logged in to reply to this topic.