Skip to content

Instantly share code, notes, and snippets.

@geeac
Forked from JiveDig/genesis_custom_loop.php
Created March 4, 2020 15:33
Show Gist options
  • Save geeac/59d713c358f0cf61aad8ac71f6ca7e46 to your computer and use it in GitHub Desktop.
Save geeac/59d713c358f0cf61aad8ac71f6ca7e46 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