Filter categories using tags
Another way that @toscho’s solution made me try, and worked for me, is this scheme: http://example.com/videos/?tag=crazy
Another way that @toscho’s solution made me try, and worked for me, is this scheme: http://example.com/videos/?tag=crazy
I’m a bit unsure of you are actually asking, so apologies if I understood it wrong. You can use get_category() to get the category object and then just simply echo the $count property value $cat_count = get_category( ‘ID OR ROW OBJECT’ ); echo $cat_count->count;
The wp_list_categories() function uses get_terms() behind the scenes, where the documentation for the exclude argument says: If $include is non-empty, $exclude is ignored. Instead you could try to exclude the term_id from the include values: $include = wp_filter_object_list( get_the_category(), // Data [ ‘term_id’ => 1 ], // Filter Data ‘NOT’, // Filter Option (exclude) ‘term_id’ … Read more
Change the last line to this: $output = strtr( wp_list_categories( ‘include=”.$cat_ids.”&title_li=&style=none&echo=0’ ), array( ‘<br />’ => ‘ // ‘ ) ); echo preg_replace( ‘@\s//\s\n$@’, ”, $output );
One these three should do the job for you… 1. Function: the_category(); News su <?php the_category(‘, ‘); ?> Displays as: News su WordPress, Computers, Blogging And if only a single category is assigned to a post, it shows up like this: News su WordPress 2. Function: get_the_category_list(); <div id=”pagine”><?php echo get_the_category_list(); ?></div> Displays as: <div … Read more
First off, note that, since your custom loop is a secondary loop/query, you should use the WP_Query class instead of query_posts(). Read why. That being said, /* main post’s ID, the below line must be inside the main loop */ $exclude = get_the_ID(); /* alternatively to the above, this would work outside the main loop … Read more
Firstly, $product->get_categories() won’t work because it’s a woocommerce function, that basically is just a wrapper for get_the_term_list, which has no sorting parameter. It’s always good to take a look at the source to know what you’re dealing with. Secondly,get_the_term_list uses get_the_terms, but it also has no sorting parameter. The latter get the terms either from … Read more
By default you can’t exclude terms from get_the_term_list. However, you can tweak the original function and make it exclude terms. The original function can be found in wp-includes/category-template.php lines 1277 to 1306. Add this to your functions.php. This new function, as said will exclude any term you specify <?php function get_modified_term_list( $id = 0, $taxonomy, … Read more
As I have stated in my comments to your question Crappy written plugins always leads to some disaster at some time. In my opinion, delete that plugin and write your own code or find a properly written plugin. There is no use changing the damaged tire while the whole car is a complete write-off 🙂 … Read more
Try adding this in your functions.php file: // Let’s stop WordPress re-ordering my categories/taxonomies when I select them function stop_reordering_my_categories($args) { $args[‘checked_ontop’] = false; return $args; } // Let’s initiate it by hooking into the Terms Checklist arguments with our function above add_filter(‘wp_terms_checklist_args’,’stop_reordering_my_categories’);