Skip to content

Instantly share code, notes, and snippets.

/front-page.php
Created Jan 9, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.