Last active
November 25, 2015 17:20
-
-
Save duroe5698/e7f95229cbe74275f07b to your computer and use it in GitHub Desktop.
Custom Homepage Template WordPress Genesis
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
| <?php | |
| add_action( 'genesis_meta', 'md_home_genesis_meta' ); | |
| /** | |
| * Add custom loop/widget support for homepage. File name should be home.php | |
| * | |
| */ | |
| function md_home_genesis_meta() { | |
| //* Add md-home body class | |
| add_filter( 'body_class', 'md_body_class' ); | |
| //* Remove the default Genesis loop | |
| remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
| //* Add home widget areas | |
| add_action( 'genesis_after_header', 'md_home_content' ); | |
| //* Default home layout | |
| add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content'); | |
| } | |
| function md_body_class( $classes ) { | |
| $classes[] = 'md-home'; | |
| return $classes; | |
| } | |
| //* Below is the code for the custom home page loop | |
| function md_home_content() { | |
| //* Custom loop and/or widget areas go here | |
| genesis_widget_area( 'home-top', array( | |
| 'before' => '<div class="home-top widget-area"><div class="wrap">', | |
| 'after' => '</div></div>', | |
| ) ); | |
| } | |
| ?> | |
| <?php genesis(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment