Customizing the query
-
Hello,
on my page I want to display products with categories and subcategories. I had made the shortcode like this:[ajax_load_more post_type=”product” taxonomy=”product_cat” taxonomy_terms=”‘ . $main_category->slug . ‘, ‘. $sub_category->slug . ‘” taxonomy_operator=”IN” taxonomy_relation=”AND” pause=”true” posts_per_page=”12″ max_pages=”0″ pause_override=”false” scroll=”false” orderby=”‘ . $orderby . ‘” order=”‘ . $order . ‘”]
The problem is, the page is now showing all products which are in the main category even if I have selected a subcategory(it displays products which are not in the selected subcategory).
I thought this part “taxonomy_terms=”‘ . $main_category->slug . ‘, ‘. $sub_category->slug . ‘” taxonomy_operator=”IN” taxonomy_relation=”AND”” will show only products which are in the subcategory of a category but it clearly not works that way. Please help me fix this problem.
- The topic ‘Customizing the query’ is closed to new replies.