Ecommerce Shopify WordPress Discussion

WordPress category page, multiple custom post types using standard category, when click how to only show category from post type

I have multiple custom post types all using 1 taxonomy 'category' this is the blog and a few other custom posts. I have a menu that only shows links to categories that only if have post in the current custom post type. I would like to click the link and go to the category page for that category but only show post that are 1, in that category (this is working) 2, post that are only in the previous custom post type(not working. Im thinking one solution is to pass a variable that stores the custom post type and the query out only category in that passed var. so far my I have this php for my menu, I want a user to click on the category and only seen post in that category and in to the custom post type. <?php if(sizeof($my_categories)) { ?> <h6>show only posy cats of post type test</h6> <?php foreach ($my_categories as $term_id) { $category = get_term_by('id', $term_id, 'category'); if($category->slug!="all-articles") { ?> <li><a href="<?php echo get_category_link( $category->term_id) ?>"> <?php echo $category->name; ?> </a></li> <?php } } } ?>
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.