Displaying child taxonomy before parent

My assumption here is that within your data structure you have only two level hierarchy: Countries are always top level parent terms (they never have their own parents), Streets are first level children, and each street only has one parent and no children. Do you need a list of all terms? In that case you … Read more

Page with Category Returning 1

few things here: 1) Your WP_Query args doesn’t look good, the proper way of querying posts by taxonomy should be: $splash_page_args = array( ‘post_type’ => ‘page’, ‘posts_per_page’ => ‘3’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘splash-homepage’, ), ), ); 2) Is there any particular reason why you’re using foreach … Read more

“If an object equals a term id then return the term name”

Great googly moogly, I figured this one out. $values = get_post_meta( get_the_ID(), ‘your_meta_whatever’, true ); foreach ($values as $value) {$term = get_term_by(‘term_id’, $value, ‘your taxonomy’); $name = $term->name echo $name;} If you want to keep ’em separated by commas or the characters your choice $values = get_post_meta( get_the_ID(), ‘your_meta_whatever’, true ); $total = count($values);$i=0; foreach … Read more

taxonomy_edit_form_fields output after term fields

Got it! It seems this action is fired within a table element. Removing the _fields part seems to have done the trick as this refers to an action fired later in the page, after the table. $term_filter_name_edit = $type . ‘_edit_form’; add_action($term_filter_name_edit, ‘box_term’, 1000, 1 ); function box_term() { echo ‘Test output’; } Reference: https://github.com/WordPress/WordPress/blob/master/wp-admin/edit-tag-form.php

outputting taxonomy hierarchy

OK, so if the empty terms shouldn’t be displayed in there, then it’ll be pretty easy 😉 All you have to do is to use wp_list_categories function: <ul> <?php wp_list_categories( array( ‘taxonomy’ => ‘sfcategory’, ‘title_li’ => false, ‘hide_empty’ => true // or false, as you wish ) ); ?> </ul>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)