How to create template for children category?

I have found answer, based on this post For cases when someone wants to have different template for child category. For example, if you have categories ordered like this: continent->country->city. And for example, you need a different template for city. First, we look if city have a children, if not, we call city template, the … Read more

Balance Tags to the_content Words Length

You better call it before returning, inside technig_content() so that it’s return value is always balanced. So, the last two lines of your function would become: $content = str_replace(‘]]>’, ‘]]>’, $content); $content = balanceTags( $content ); return $content; Having said that, I don’t think it’s a good way of handling your output, since you don’t … Read more

Category removal – Portfolio Category:

It looks like that text is coming from your theme. I would create a child theme (you’ll only need style.css to start with), then copy whatever file it’s coming from (probably header.php but could be in another file, possibly single.portfolio.php) into your child theme. From there, remove the whole section of code that looks something … Read more

Add subcategories posts to the counts column at the admin’s categories list

You can change an array of get_terms() arguments with two filters: get_terms_defaults filters the terms query default arguments; get_terms_args filters the terms query passed arguments. For example, this code will change the default value for the pad_counts parameter for all queries related to categories and called from the administrative part of the site. add_filter( ‘get_terms_defaults’, … Read more

How to apply wordpress ‘with_front’ = false for categories?

The register_taxonomy_args filter should do the job intercepting the arguments for the specified taxonomy: add_filter( ‘register_taxonomy_args’, ‘cyb_modify_category_args’, 99, 2 ); function cyb_modify_category_args( $args, $taxonomy ) { if( ‘category’ === $taxonomy && is_array( $args ) ) { $args[‘rewrite’][‘with_front’] = false; } return $args; }

Exclude category from WP_Query args not working

After a lot of searching I ended up finding this option that worked: Adding one exclude parameter to the get_terms list at the top. Like this: $tourDateArtists = get_terms( array( ‘taxonomy’ => ‘category’, ‘hide_empty’ => false, ‘exclude’ => ‘1’, ) ); Still not sure why neither ‘cat’ => ‘-1’, nor the particular tax_query param I … Read more