Last active
July 24, 2017 08:33
-
-
Save braddalton/5737ee5b12c70a927dbc9074c921598d to your computer and use it in GitHub Desktop.
Display Genesis Featured Posts In Columns https://wpsites.net/web-design/display-genesis-featured-posts-in-horizontal-grid/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
genesis_register_sidebar( array( | |
'id' => 'home-top', | |
'name' => __( 'Home Top', 'genesis' ), | |
) ); | |
add_action( 'genesis_before_content_sidebar_wrap', 'home_page_widget' ); | |
function home_page_widget() { | |
if ( is_front_page() ) { | |
genesis_widget_area( 'home-top', array( | |
'before' => '<div class="home-top widget-area">', | |
'after' => '</div>', | |
) ); | |
} | |
} | |
add_image_size( 'vertical-thumbnail', 680, 900, true ); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.home-top .entry .entry-title { | |
font-size: 16px; | |
text-align: center; | |
} | |
.home-top .entry { | |
display: inline-block; | |
padding: 1%; | |
width: 33.33333333333%; | |
} | |
@media only screen and (max-width: 860px) { | |
.home-top .entry { | |
display: inline-block; | |
width: 100%; | |
} | |
// Another method | |
.home-top .entry { | |
width: 31.6239%; | |
float: left; | |
margin-left: 2.5641%; | |
} | |
.home-top .entry:nth-of-type(3n+1){ | |
margin-left: 0; | |
} | |
.home-top .entry .entry-title { | |
font-size: 16px; | |
text-align: center; | |
} | |
@media only screen and (max-width: 860px) { | |
.home-top .entry { | |
width: 100%; | |
float: none; | |
margin: auto; | |
} | |
.home-top { | |
margin-bottom: 40px; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment