Skip to content

Instantly share code, notes, and snippets.

@thewebattic
Created June 6, 2013 18:59
Show Gist options
  • Save thewebattic/5723987 to your computer and use it in GitHub Desktop.
Save thewebattic/5723987 to your computer and use it in GitHub Desktop.
home.php balance theme
<?php
add_action( 'genesis_meta', 'balance_home_genesis_meta' );
/**
* Add widget support for homepage.
*
*/
function balance_home_genesis_meta() {
if ( is_active_sidebar( 'home-featured-top' ) ) {
add_action( 'genesis_after_header', 'balance_home_loop_helper' );
}
}
/**
* Display widget content for home featured sections.
*
*/
function balance_home_loop_helper() {
if ( is_active_sidebar( 'home-featured-top' ) ) {
echo '<div id="home-featured"><div class="wrap clearfix">';
echo '<div class="home-featured-top">';
dynamic_sidebar( 'home-featured-top' );
echo '</div><!-- end .home-featured-top -->';
echo '</div><!-- end .wrap --></div><!-- end #home-featured -->';
}
}
remove_action( 'genesis_loop', 'genesis_do_loop' );
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' ) ) {
genesis_grid_loop( array(
'features' => 1,
'feature_image_size' => 620,
'feature_image_class' => 'align none post-image',
'feature_content_limit' => 250,
'grid_image_size' => 'grid',
'grid_image_class' => 'align none post-image',
'grid_content_limit' => 250,
'more' => __( 'Continue reading...', 'genesis' ),
'posts_per_page' => 4,
'category__not_in' => -13, // exclude posts from this category
) );
}
else {
genesis_standard_loop();
}
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment