Display Taxonomy Description on edit-tags screen?

The code for where you’ve circled can be found in wp-admin/edit-tags.php:295 You’ll notice there’s nothing there. No hooks, no filters. You’re out of luck for tapping into that cleanly. Luckily you can do a duct tape method to still add it with jQuery. You can dynamically put text where you’ve circled by doing something like: … Read more

wp_set_object_terms() not adding new term to custom post and custom taxonomy

Use the fourth parameter in wp_set_object_terms() and pass true. wp_set_object_terms( $pid, $name, ‘name’, true); wp_set_object_terms( $pid, $email, ’email’, true); wp_set_object_terms( $pid, $birthdate, ‘dob’, true); Though I do find it weird to use taxonomies for name, email and birthdate. I’d recommend to use metadata for this. See: https://codex.wordpress.org/Function_Reference/update_post_meta Taxonomies are meant for categories and tags like … Read more

Tag page with Custom Post Types not returning any posts

WordPress, by default, shows only posts on tags and categories archives… So if you want to show your custom post type in there, then you’ll have to make WordPress do that… function add_news_articles_to_categories_and_tags( $query ) { if ( ! is_admin() && $query->is_main_query() && ($query->is_category || $query->is_tax ) ) { $query->set( ‘post_type’, array(‘post’, ‘news_article’) ); // … Read more

How to order by taxonomy using wp_query

Jose, as this post (Using wp_query is it possible to orderby taxonomy?) says it doesn’t make sense to sort by taxonomy. A post could belong to multiple terms. IF in your setup a post will only belong to one term, then consider making the taxonomy a custom field/meta key instead. Then you will be able … Read more

Use get_the_terms to list subcategories of custom taxonomy

When you use get_the_terms() it returns a term object. One of the fields is ‘parent’ which stores the ID of the term parent. So you can compare the current term’s parent to the parent term that you are looking for. $desired_parent_name=”fruits”; $desired_parent_id = get_term_by(‘name’, $desired_parent_name)->term_id; foreach ($terms as $term) { if $term->parent == $desired_parent_id { … Read more

WordPress User Taxonomy Saved Values

There are two errors in your code. First one is the inconsistency in field names. Here’s your checkbox field: <input type=”checkbox” name=”competence-<?php echo esc_attr( $term->slug ); ?>” id=”competence-<?php echo esc_attr( $term->slug ); ?>” value=”<?php echo esc_attr( $term->slug ); ?>” <?php checked( true, is_object_in_term( $user->ID, ‘competence’, $term ) ); ?> /> And here’s the part you’re … Read more

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