Trouble with custom query in post grid page template
-
Topic
-
I am hoping to use the grid to display taxonomies for a custom post type using the code:
function jma_classes_query( $query, $args ){ if( $args['query'] == 'jma_classes_query' ){die(); $query = array( 'post_type' => 'jma_class', 'orderby' => 'meta_value', 'sf_meta_key' => 'class_schedule/class_start_date', 'order' => 'ASC', 'tax_query' => array( array( 'taxonomy' => 'class_types', 'field' => 'slug', 'terms' => $args['this_tax'] ) ), 'paged' => $paged ); } return $query; } add_filter( 'themeblvd_posts_args', 'jma_classes_query', 10, 2 );
setting custom fields:
query -> jma_classes_query
and:
this_tax -> fun-sewing-classeswhere fun-sewing-classes would be changed to reflect the slug of the tax to be displayed.
Does this seem viable? right now it doesn’t die(); as I would expect it to so I’m not even getting step one right.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- You must be logged in to reply to this topic.