Skip to content

Instantly share code, notes, and snippets.

@About2git
Forked from srikat/functions.php
Last active August 29, 2015 14:15
Show Gist options
  • Save About2git/5a5f7339f4ca541e72bd to your computer and use it in GitHub Desktop.
Save About2git/5a5f7339f4ca541e72bd to your computer and use it in GitHub Desktop.
How to display Posts in 5 columns when using Genesis Sandbox Featured Content Widget Plugin.
//* Custom image size for Featured images in the Below Header widget area
add_image_size( 'below-header', 216, 120, true );
//* Register below header widget area
genesis_register_sidebar( array(
'id' => 'below-header',
'name' => __( 'Below Header', 'themename' ),
'description' => __( 'This is a widget area that can be placed after the header', 'themename' ),
));
add_action( 'genesis_after_header', 'sk_featured_posts' );
/**
* Display Below Header widget area after header
*
* Context: Front page.
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/display-posts-5-columns-using-genesis-sandbox-featured-content-widget-plugin/
*/
function sk_featured_posts() {
if ( ! is_front_page() ) {
return;
}
genesis_widget_area( 'below-header', array(
'before' => '<div class="below-header widget-area"><div class="wrap">',
'after' => '</div></div>',
));
}
/* # Posts in 5 columns in Below Header widget area
---------------------------------------------------------------------------------------------------- */
.below-header {
padding-top: 40px;
/*padding-bottom: 40px;*/
}
.one-fifth {
float: left;
width: 18%;
margin-left: 2.5%;
}
.one-fifth.first {
clear: left;
margin-left: 0;
}
.below-header .featured-content .entry {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
.below-header .featured-content .entry p {
margin-bottom: 0;
}
.below-header .featured-content .entry p a {
display: block;
}
.below-header .featured-content .entry .alignnone {
margin-bottom: 0;
}
@media only screen and (max-width: 568px) {
.one-fifth {
float: none;
width: 100%;
margin-left: 0;
}
.below-header .featured-content .entry {
margin-bottom: 40px;
}
.below-header .featured-content .entry:last-child {
margin-bottom: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment