Skip to content

Instantly share code, notes, and snippets.

Created January 9, 2017 16:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/98f574562533be7f7c880ebb13a6b689 to your computer and use it in GitHub Desktop.
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.
<?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