Taxonomy or Custom Field

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

Set post terms by term id

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

Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category

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

Custom taxonomy and post type rewrite rules

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