Taxonomy terms with the same name are updated between separate custom post types
Ok found a ticket on the trac. It’s a bug and has been around for quite some time (~4 years). Hopefully it’s fixed soon http://core.trac.wordpress.org/ticket/5809
Ok found a ticket on the trac. It’s a bug and has been around for quite some time (~4 years). Hopefully it’s fixed soon http://core.trac.wordpress.org/ticket/5809
Change the value of each checkbox to term slug instead of name, and change wp_set_post_terms($pid,array($_POST[‘genre’]),’gen re’,true); To wp_set_post_terms($pid,(array)$_POST[‘genre’],’gen re’,true);
This will probably be easier to do when the following filter lands: http://core.trac.wordpress.org/ticket/18752 Update July 16. 2012: Fixed.
Are you sure you are not using a custom taxonomy in your custom post type? Taxonomies for Custom Post Types have to use get_terms instead of get_category. More information on get_terms from the WordPress Codex: http://codex.wordpress.org/Function_Reference/get_terms
I’m not sure why an Author post-type has a “title” taxonomy, unless you meant books or something, or even why you can’t use the built-in published date field, but here goes: Store the date published as a timestamp in a custom field. You can do the conversions behind the scenes and just show users the … Read more
Have you made sure your CPT is using the ‘has_archive’ => true, parameter? And try something like; wp_reset_query(); if (is_post_type_archive(‘articles’)){ // do something }
In your code you are just storing an “array” in the variable $themeOne. The code you should be using to make the query is: $themeOne = new WP_Query(array( ‘tax_query’ => array( array( ‘taxonomy’ => ‘event-themes’, ‘terms’ => ‘boat-theme’ ) ) )); The result should be an array of objects. You can then access these using … Read more
When dealing with this, it turned out that the $parent var had to be casted as an int. Looking at the function wp_set_object_terms, it tests the param $parent with is_int(). The var $parent was coming from $_POST which was sent though http post using ajax. Somewhere along the way, probably on the javascript side, my … Read more
Well, I do not know if this is quite OK, but is returning the expected results … so at the moment this it is enough for me. function my_custom_get_terms( $my_tax, $my_category, $show_all = true ){ global $wpdb; global $pagename; $query = “SELECT Count(wp_posts.ID) AS my_term_count, wp_term_taxonomy.term_taxonomy_id, wp_term_taxonomy.taxonomy, wp_terms.name, wp_terms.term_id, wp_terms.slug AS term_slug, wp_terms.term_group, wp_terms_1.slug FROM … Read more
I hope i understand you 🙂 I think the easiet way (in my humble opion) the best way is to use taxomonies like so: function portfolio_taxomony() { register_taxonomy( ‘portfolio’, ‘post’, array( ‘hierarchical’ => true, ‘label’ => ‘Web Design’, ‘query_var’ => true, ‘rewrite’ => true ) ); } add_action( ‘init’, ‘portfolio_taxomony’, 0 ); (Web Design if … Read more