Tag Info

New answers tagged


I got it solved on my own so, wanted to answer my own question. in options table the results are cached, so I queried it and delete that. SELECT * FROM `wp_options` WHERE `option_name` like '%department%' department is my taxonomy name here. You can check the function _get_term_hierarchy in taxonomy.php in wp-includes folder.


Try this. $locations = get_terms( 'location', 'hide_empty=0&orderby=term_group' ); The codex says to avoid using term_group but it should be fine. It was never fully implementet but, according to others, its used quite often.


I found my answer from another site after hours of searching! - http://wpquestions.com/question/showChrono/id/10819 <?php // List posts by the terms for a custom taxonomy of any post type $post_type = 'product'; $tax = 'products'; $tax_args = array( 'order' => 'DESC', 'parent' => 0 ...


It's hard to understand how you use your taxonomy and where you want to display it. Does your posts have a custom taxonomy and you want to display it there? Or you have some page, like /issues/, with a list of posts that linked to a certain issue number and grouped some how? So, if you want to retrieve a categories based on custom taxonomy, you could use ...


You have a couple of flaws here: ALWAYS code in a way with a mindset of that your code will fail. This is very important. Most people code with a perfect world mindset. A perfect world will never happen. Always think of what will happen when your code fail. As example, in your code, $terms return an object of term objects if everything pans out. $terms ...


The problem is you are giving 0 as a value to $i, every time the foreach loop executes, so, when the last if statement executes, every time the comparison is 1 != 3, and the comma will always be printed. Try to declare $i = 0; outside the foreach loop. Like this: $terms = get_terms('food_tag'); $i = 0; foreach($terms as $term){ //the code here } Also, ...

Top 50 recent answers are included