How to hide category

Replace all the call to in_category(‘featured’) with the custom function inCategory(‘featured’), declare it on your functions.php: /** * @param string $category * * @return bool */ function inCategory($category) { global $wpdb, $post; if ( ! $post) { return false; } $query = $wpdb->prepare(“SELECT COUNT(t.term_id) FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON tt.term_id … Read more

How to use wp_list_categories with plugin category?

I just tried the plugin you mentioned. You need to use following code to get categories from that plugin: wp_list_categories(‘title_li=Carousel%20Categories&orderby=name&taxonomy=carousel_category&hide_empty=0′); Notice the ‘taxonomy’ parameter in the querystring, it has the value of custom taxonomy registered by plugin. The default value is ‘category’ which is WordPress default category. For any other custom taxonomy you need to … Read more

Show different menu on each woocommerce category page

This is the solution I found that works: As usual in these cases, override the archive product template from your woocommerce plugin folder by copying archive-product.php to yourtheme/woocommerce/archive-product.php. Edit the file, and add this code at the beginning (or wherever the menu needs to show up): <?php if ( is_tax( ‘product_cat’, ‘cat1’ )) { wp_nav_menu( … Read more

query_posts by category_name and custom taxonomy

$args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘channel’, ‘field’ => ‘slug’, ‘terms’ => array( ‘news’, ‘comedy’ ), //this is by slug ), array( ‘taxonomy’ => ‘category’, ‘field’ => ‘term_id’, ‘terms’ => array( 103, 115, 206 ), //this is by id ) ) ); $query = new WP_Query( … Read more

wp_list_categories not excluing multiple ids

I’m pretty sure this is a Codex error and that the string that exclude parameter expects for wp_list_categories() is really meant for non-hierarchical tags, such as blue,red where hierarchical you need to pass an array of integers: $args = array( ‘orderby’ => ‘ID’, ‘show_count’ => 1, ‘taxonomy’ => ‘portfolio-type’, ‘use_desc_for_title’ => 1, ‘echo’ => 0, … Read more

Filter By Category Dropdown List With Custom Taxonomies

Just from skimming your code, it actually pretty much does the same as the WordPress API function wp_dropdown_categories(). It isn’t as sophisticated though, no insult intended. Because wp_dropdown_categories() is capable of displaying deeper leveled hierarchies – correctly – then your own function, I can’t see a reason for not just using wp_dropdown_categories() for your purpose. … Read more