Get URL for specific post type and current tag

If the URL to the ‘cancer’ taxonomy term in your example looked like this: yourwebsite.com/topics/cancer/ then you could filter these results by post type with a URLs structured like this: yourwebsite.com/topics/cancer/?post_type=question Just put this in functions.php add_filter( ‘pre_get_posts’, ‘wp123_post_type_by_taxonomy’ ); function wp123_post_type_by_taxonomy( $query ) { if( is_tax( ‘topics’ ) && $query->is_main_query() ) { // get … Read more

Custom Taxonomy and tax_query Issue?

I think that the problem is right in your code, but it’s really easy to overlook. Let’s take a closer look at this part: <div class=”col-md-4″> <?php echo $category_name = $get_categories[$i]->name; ?> </div> <?php $args = array( ‘post_type’ => ‘team’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘Team_Category’, ‘field’ => ‘slug’, ‘terms’ => $category_name ) ) … Read more

Remove “-2” from a Toolset Types URL with the same post name

It can be done by using the request filter. Something like this function alter_the_query($request) { return array(‘page’ => 1, ‘pagename’ => null); } add_filter(‘request’,’alter_the_query’); Here it forces display of post 1, though of course you will want to do a query to determine the ID. For that, it might prove easiest to first parse the … Read more

Custom Taxonomy Breadcrumb Navigation

Using your method, I’ve edited it a bit to make it more viable. Here’s the code, below I’ll explain. <ul> <li><a href=”https://wordpress.stackexchange.com/questions/149424/<?php echo home_url(); ?>/projects”>Projects</a></li> <?php $term = get_term_by(“slug”, get_query_var(“term”), get_query_var(“taxonomy”) ); $tmpTerm = $term; $tmpCrumbs = array(); while ($tmpTerm->parent > 0){ $tmpTerm = get_term($tmpTerm->parent, get_query_var(“taxonomy”)); $crumb = ‘<li><a href=”‘ . get_term_link($tmpTerm, get_query_var(‘taxonomy’)) . ‘”>’ … Read more

remove custom taxonomy metabox form custom post type

Change your taxonomy registration parameter show_ui to false… register_taxonomy(‘package_hotel’,’package’,array( ‘hierarchical’ => false, ‘labels’ => $Package_labels, ‘show_ui’ => false, ‘update_count_callback’ => ‘_update_post_term_count’, ‘query_var’ => true, ‘show_in_nav_menus’ => false, ‘rewrite’ => array( ‘slug’ => ‘hotels’ ), ));

Create separate template for shared custom taxonomy with shared terms

See, It’s quite difficult to have path like site/books/product_category/horror/ site/movies/product_category/horror/ As wordpress functionality will conflict between custom_post_type & their taxonomy if try to keep url like you mentioned. I suggest you consider the I mentioned below as a solution of your problem. site/product_category/horror/?post_type=books site/product_category/horror/?post_type=movies Now to keep template as per shared terms, Create two templates … Read more