Last active
September 10, 2017 18:12
-
-
Save topleague/1c1ffa32bb64f80fdfb657b4a4f39281 to your computer and use it in GitHub Desktop.
Magazine Grid Template File in Genesis (Front Page)
This file contains hidden or 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
//* Create a front-page.php file and poaste the following code | |
<?php | |
//* Force content-sidebar layout | |
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' ); | |
add_action( 'genesis_meta', 'magazine_home_genesis_meta' ); | |
function magazine_home_genesis_meta() { | |
// Remove the default Genesis loop | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
// Add homepage widgets | |
add_action( 'genesis_loop', 'magazine_homepage_widgets' ); | |
} | |
function magazine_homepage_widgets() { | |
echo '<div class="magazine">'; | |
// Featured Top. | |
genesis_widget_area( "featured-top", array( | |
'before' => '<div class="featured-top front-page-section"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
// Featured Story. | |
genesis_widget_area( "featured-story", array( | |
'before' => '<div class="featured-story front-page-section"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
// Featured Stories. | |
genesis_widget_area( "featured-stories", array( | |
'before' => '<div class="featured-stories front-page-section"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
// Featured Posts. | |
genesis_widget_area( "featured-posts", array( | |
'before' => '<div class="featured-posts front-page-section"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
echo '</div>'; | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment