How to list terms by first letter, as in A’s then B’s etc
$taxonomy is possibly not set in this example? or maybe you’ve set it somewhere else in your code? also may want to check out php’s ctype functions here.
$taxonomy is possibly not set in this example? or maybe you’ve set it somewhere else in your code? also may want to check out php’s ctype functions here.
I have a plugin, Custom Taxonomy Sort, that allows you to sort taxonomy terms in any order that you might want. After installing the plugin, there will be an order field for each term. It will save these values as integers and will properly sort your taxonomy terms. By default, it will use the order … Read more
I built something similar for a client not too long ago. I believe your question is if it is possible — I can definitely say yes there. How would you go about it? Well, as I don’t have the code handy, I’ll give you a brief run-down of the steps I went about. I made … Read more
I think you need to set the hierarchy to false, like this: register_taxonomy( ‘internal_name’, ‘object_type’, array( ‘hierarchical’ => false ) );
Simply add the ‘category__in’ => $category_id_array argument from your second query inside your first query. If this doesn’t work, make a tax_query, with both kund and post_category taxonomies
get_terms(‘apptypes’,’orderby=id&parent=0′); parent argument is used to get direct children of this term (only terms whose explicit parent is this value). If 0 is passed, only top-level terms are returned. Default is an empty string. See Codex.
Try using this function to avoid your problem: function sld_unregister_taxonomy_from_object_type($taxonomy, $object_type) { global $wp_taxonomies; if ( !isset($wp_taxonomies[$taxonomy]) || !get_post_type_object($object_type) ) return false; foreach (array_keys($wp_taxonomies[$taxonomy]->object_type) as $array_key) { if ($wp_taxonomies[$taxonomy]->object_type[$array_key] == $array_key) { unset ($wp_taxonomies[$taxonomy]->object_type[$array_key]); return true; } } return false; } e.x.: function mwm_unregister_taxonomy(){ sld_unregister_taxonomy_from_object_type( ‘post_tag’, ‘post’ ); } add_action( ‘init’, ‘mwm_unregister_taxonomy’);
Just check the total number of posts found: if($your_query->found_posts > 20) … and decide how do you want your mark-up to be. If want to see how many products are associated with a certain product_category term, use get_term() and check out the ‘count’ property
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
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