Skip to content

Instantly share code, notes, and snippets.

@JiveDig
Last active March 4, 2020 15:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JiveDig/c342af163011cd4294b0 to your computer and use it in GitHub Desktop.
Save JiveDig/c342af163011cd4294b0 to your computer and use it in GitHub Desktop.
wp_query using genesis_custom_loop. To alter content use standard genesis add_action and remove_action hooks
<?php
//* Custom loop WITH pagination
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'bhl_do_resident_query' );
function bhl_do_resident_query() {
global $paged;
global $query_args;
// Show Residents
$args = array(
'post_type' => 'resident',
'posts_per_page' => '36',
'post_status' => 'publish',
'paged' => $paged,
);
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