get taxonomy terms for parent and child

You should have two foreach loops. One for getting parent taxonomy terms, and second for getting child taxonomy terms. In the second foreach you need to specify the parent taxonomy term ID which is $parent_term->term_id from the first foreach loop. foreach( get_terms( ‘products-category’, array( ‘hide_empty’ => false, ‘parent’ => 0 ) ) as $parent_term ) … Read more

custom taxonomies on permalink

What you’re looking for is a 301 redirect. I use two plugins to catch do this. One notify’s me of 404 errors ( http://wordpress.org/extend/plugins/404-notifier/ ) and the other makes writing the 301 redirects easy ( http://wordpress.org/extend/plugins/simple-301-redirects/ ). You could also write the 301 redirects in your .htaccess file and dig through the server logs to … Read more

Count number of post in Taxonomy?

The function you are looking for is get_term() http://codex.wordpress.org/Function_Reference/get_term and the code would look something like this: $term = get_term( 1, ‘category’ );//for example uncategorized category echo ‘count: ‘. $term->count;

How to fix a double slash in custom permalinks with hierarchical taxonomy’s?

There is a quick and somewhat dirty potential solution to this. I say ‘potential’ because I can’t spot the problem by looking at the code. I only have my suspicions. Instead of passing a separator like that. Try trailingslashit. } else $chain .= trailingslashit($name); return $chain; I am guessing at where the problem is based … Read more