Advertisement
Guest User

Untitled

a guest
Dec 17th, 2012
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. // Customize the Loop
  2. remove_action( 'genesis_loop', 'genesis_do_loop' );
  3. add_action( 'genesis_loop', 'my_cpt_taxonomy_custom_loop' );
  4.  
  5. function my_cpt_taxonomy_custom_loop() {
  6.  
  7. global $paged;
  8. global $query_args; // any wp_query() args
  9.  
  10. // Get term
  11. $term = get_query_var( 'term' );
  12.  
  13. $args = array( 'order' => 'ASC',
  14. 'orderby' => 'title',
  15. 'tax_query' => array(
  16. 'relation' => 'OR',
  17. array(
  18. 'taxonomy' => 'location',
  19. 'field' => 'slug',
  20. 'terms' => $term
  21. ),
  22. array(
  23. 'taxonomy' => 'services',
  24. 'field' => 'slug',
  25. 'terms' => $term
  26. ),
  27. array(
  28. 'taxonomy' => 'keyword',
  29. 'field' => 'slug',
  30. 'terms' => $term
  31. )
  32. ),
  33. 'paged' => $paged
  34. );
  35.  
  36. // Accepts WP_Query args (http://codex.wordpress.org/Class_Reference/WP_Query)
  37. genesis_custom_loop( wp_parse_args( $query_args , $args ) );
  38.  
  39. } // End my_cpt_taxonomy_custom_loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement