Created
January 9, 2017 16:46
-
-
Save anonymous/98f574562533be7f7c880ebb13a6b689 to your computer and use it in GitHub Desktop.
https://wpvkp.com/add-custom-homepage-widgets-in-genesis-theme/ Please check this post if you want to know how these custom widgets are working.
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
<?php | |
/* | |
Template Name: HomePage | |
*/ | |
add_filter( 'genesis_attr_site-inner', 'wpvkp_att' ); | |
function wpvkp_att( $attributes ) { | |
$attributes['role'] = 'main'; | |
$attributes['itemprop'] = 'mainContentOfPage'; | |
return $attributes; | |
} | |
add_filter( 'genesis_structural_wrap-site-inner', '__return_empty_string' ); | |
get_header(); | |
genesis_widget_area( 'home-featured', array( | |
'before' => '<div class="home-featured widget-area">', | |
'after' => '</div>', | |
)); | |
genesis_widget_area( 'home-middle', array( | |
'before' => '<div class="home-featured widget-area">', | |
'after' => '</div>', | |
)); | |
genesis_widget_area( 'home-featured-posts', array( | |
'before' => '<div class="home-featured-posts widget-area"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
genesis_widget_area( 'home-bottom', array( | |
'before' => '<div class="home-featured-posts widget-area"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
add_filter( 'body_class', 'bw_home_body_class' ); | |
function bw_home_body_class( $classes ) { | |
$classes[] = 'featured-posts-home'; | |
return $classes; | |
} | |
get_footer(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment