Skip to content

Instantly share code, notes, and snippets.

@bhwebworks
Last active October 14, 2015 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhwebworks/4286425 to your computer and use it in GitHub Desktop.
Save bhwebworks/4286425 to your computer and use it in GitHub Desktop.
// Customize the Loop
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'my_cpt_taxonomy_custom_loop' );
function my_cpt_taxonomy_custom_loop() {
global $paged;
global $query_args; // any wp_query() args
// Get term
$term = get_query_var( 'term' );
$args = array( 'order' => 'ASC',
'orderby' => 'title',
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'first-taxonomy',
'field' => 'slug',
'terms' => $term
),
array(
'taxonomy' => 'second-taxonomy',
'field' => 'slug',
'terms' => $term
),
array(
'taxonomy' => 'third-taxonomy',
'field' => 'slug',
'terms' => $term
)
),
'paged' => $paged
);
// Accepts WP_Query args (http://codex.wordpress.org/Class_Reference/WP_Query)
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