Last active
October 14, 2015 01:28
-
-
Save bhwebworks/4286425 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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