Genesis Display Posts from One Category on Home Page
You can easily display posts from a specific category on home page or blog page of any Genesis child theme with the following simple code snippet.Before adding this code,decide which category posts you really want to display on home page,then find the ID of that category.Some may not want to display all category posts on front page, for them it's a perfect solution to show posts from one category only.
Here's the code to show posts from one category,it works only in genesis themes.Finally replace ID number of 12 with your category ID.Simply paste the following code snippet to your genesis child theme's functions.php file.
add_action( 'pre_get_posts', 'one_category_home_page' );
/**
* @author Syed Bavajan
* @example http://mygenesisthemes.com/
* @copyright 2015 My Genesis Themes
* @post link http://mygenesisthemes.com/genesis-display-posts-one-category-home-page/
*/
function one_category_home_page( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'cat', '12' );
}
}
If you face any difficulty and to get additional help use comment form,i will help you.