Listing all term items alphabetically / sorting loop
Listing all term items alphabetically / sorting loop
Listing all term items alphabetically / sorting loop
You probaby want get_terms(). WordPress keeps a count of the number of posts that use a taxonomy and you can filter your query using it: // get all the terms in the ‘category’ taxonomy $terms = get_terms(‘knife’); // list all the terms that have at least one post foreach ($terms as $term) { echo “{$term->name} … Read more
There’s actually an option in Types to hide a post type, and for child posts it may well default to “off.” Additionally, you should be able to edit the child post type from the parent type. Or is something actually breaking here?
You should be using the register_deactivation_hook and/or register_uninstall_hooks. That may be why some functions don’t work. I’d have to do some testing to be sure, but loading your method directly like WP_Plugin_Janitor::cleanup( $opt, $cpt, $tax ); seems like a pretty good way to skip over some of the WordPress load sequence or to run things … Read more
sql select for post_title and a term name
When using the get_terms and trying to order the terms using the ‘order’ and/or ‘orderby’ does not work
Ordering taxonomies by rank
You can run a query with a tax_query parameter which excludes certain taxonomy terms. See this answer. As for where to run the query, you can either have a form that submits to the page it’s on (you’ll need to locate an appropriate template file being called for that page or create a custom one) … Read more
Have you tried wp_set_object_terms? …which needs to be placed after your call to wp_insert_post as it requires the post ID in order to attach the correct terms, to the right taxonomy with the right post. //add_action(‘plugins_loaded’, ‘newpost’); # will not work, user not authenticated add_action(‘init’, ‘newpost’); // will work, user authenticated function newpost() { if … Read more
You might like to follow this post as well as it appears to be essentially the same… Display the Terms from a Custom Taxonomy Assigned to a Post(inside the loop) in Hierarchial Order