Custom Post Type Category Query
-
In my category.php page, I am currently using the below code to call the posts:
<?php $loop = new WP_Query(array('post_type'=>'menu', 'taxonomy'=>'category', 'term' => 'dinnerappetizers', 'orderby' => 'menu_order', 'order' => 'asc')); ?>
However, I would like this query to contain a variable for the “term” depending on which category a user navigates to. I have been through site after site and nothing works out.
If a user clicks on Lunch Appetizers, they are taken to the category.php with the term lunchappetizers term in the query, and if Dinner Appetizers, are taken to the category.php with dinnerappetizers as the term in the query.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Custom Post Type Category Query’ is closed to new replies.