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

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

Why “Warning: Invalid argument supplied for foreach()”

According to the documentation, get_the_terms() returns an array of WP_Term objects, or a boolean false value, or a WP_Error object. The last two won’t work with foreach(). You could update your code to check for these conditions: $orgs_in_post = get_the_terms($post[‘ID’], ‘company’); if ( is_array( $orgs_in_post ) ) { foreach ($orgs_in_post as $org_single) { array_push($recent_companies, $org_single->term_id); … Read more

Set post terms on post publish

The argument from pending_to_publish action, $post_id in your case, is not ID but array (callback to publish). I think it would be better to use the publish_post action, that way $post_id will actualy be the post id. Also this is a very general action so if you have multiple post types it would be wise … Read more

get_terms problem : related articles

get_the_term_list() is retrieving the terms attached to the post that are in the taxonomy “types”. get_terms() is designed to retrieve all the terms within a taxonomy. What you are trying to do is use get_terms() for a specific term in a taxonomy, not a taxonomy itself. You need to do: $terms = get_terms(‘type’);

How can i list the categories of a post type, the taxonomy

This should get you started function my_cpt_cats() { $parent = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); $args = array( ‘type’ => ‘post’, ‘child_of’ => $parent->term_id, ‘parent’ => ”, ‘orderby’ => ‘slug’, ‘order’ => ‘DESC’, ‘hide_empty’ => 1, ‘hierarchical’ => 1, ‘exclude’ => ”, ‘include’ => ”, ‘number’ => ”, ‘taxonomy’ => ‘YOUR_TAXONOMY’, … Read more

Custom Field as Custom Taxonomy?

Without knowing exactly how your input form looks, I can only give you the following as a suggestion. Basically you verify that you want/have permission to save the data and then take the meta’s input and set it as a term in your taxonomy via wp_set_object_terms(). You’ll want to fire this every time a post … Read more

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