Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
Forked from JiveDig/new_gist_file.php
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save jamiemitchell/dde04a1107a525c8dda2 to your computer and use it in GitHub Desktop.

Select an option

Save jamiemitchell/dde04a1107a525c8dda2 to your computer and use it in GitHub Desktop.
//* Replace the standard loop with our custom loop
//* props to David Wang, he is the man!
// @author David Wang
// @link http://genesissnippets.com/genesis-custom-loop/
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'child_do_sticky_post', 5 );
function child_do_sticky_post() {
global $paged; // current paginated page
global $query_args; // grab the current wp_query() args
$exclude_ids = '143';
$args = array(
'paged' => $paged, // respect pagination
'post_type' => 'staff',
'post__in' => array( 143 ),
);
genesis_custom_loop( wp_parse_args($query_args, $args) );
}
add_action( 'genesis_loop', 'child_do_custom_loop', 10 );
function child_do_custom_loop() {
global $paged; // current paginated page
global $query_args; // grab the current wp_query() args
$args = array(
'paged' => $paged, // respect pagination
'post_type' => 'staff',
'post__not_in' => array( 143 ),
'orderby' => 'title',
'order' => 'ASC',
);
genesis_custom_loop( wp_parse_args($query_args, $args) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment