Skip to content

Instantly share code, notes, and snippets.

@KnowTheCodePro
Created April 28, 2016 14:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KnowTheCodePro/24cb673ccbf9d3d7959b7851530aaa7d to your computer and use it in GitHub Desktop.
Save KnowTheCodePro/24cb673ccbf9d3d7959b7851530aaa7d to your computer and use it in GitHub Desktop.
Genesis Home Page that uses the Genesis > Theme Settings > Blog Page Template
<?php
/**
* Home page (posts page)
*
* @package Altitude
* @since 1.0.0
* @author hellofromTonya
* @link https://knowthecode.io
* @license GNU General Public License 2.0+
*/
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'altitude_do_home_loop' );
/**
* Use the Genesis custom loop and the settings in Genesis > Theme Settings > Blog Page Template
* to allow you to set the categories and number of posts on the home page.
*
* @since 1.0.0
*
* @return void
*/
function altitude_do_home_loop() {
$include = genesis_get_option( 'blog_cat' );
$blog_cat_exclude = genesis_get_option( 'blog_cat_exclude' );
$exclude = $blog_cat_exclude ? explode( ',', str_replace( ' ', '', $blog_cat_exclude ) ) : '';
$paged = get_query_var( 'paged' ) ?: 1;
$query_args = wp_parse_args(
genesis_get_custom_field( 'query_args' ),
array(
'cat' => $include,
'category__not_in' => $exclude,
'showposts' => genesis_get_option( 'blog_cat_num' ),
'paged' => $paged,
)
);
genesis_custom_loop( $query_args );
}
genesis();
@westerdaled
Copy link

Hi

I am about to apply revision 1 to the latest versions of Metro Pro and Genesis Framework 2.4 - . Out of interest have you tested revision 1 on any of these versions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment