Order terms inside a select dropdown

I was working on someone else WP installation so I can get the info of WP Database to show Products information in a side-page. I’ve noticed that they have a plugin installed (Taxonomy order) that always return the terms posts in the same orden. Sorry for the confusion!

What hooks/filters are there to alter selected terms on post save?

It is always ‘save_post’ (or ‘wp_insert_post’ immediately after this). In $_POST[‘tax_input’] you will find all the terms for all taxonomies associated with the current post. Example: ‘tax_input’ => array ( ‘location’ => array ( 0 => ‘0’, ), ), To change the terms you have to call wp_set_post_terms( $post_ID, $tags, $taxonomy ); manually, just changing … Read more

get_terms() but with additional dimensions?

I think I have cracked this, thanks to a Redditor’s help. The advice was, effectively: start with 3 and 4 (“Use get_posts() to build an array of post ids that match conditions 3 and 4”) then refine by 1 and 2 (“then drop that array into the object_ids argument for your get_terms() query”)… Like… // … Read more

List post from current taxonomy children

I had an idea of combining the first code with this solution that lists posts from a specifik taxomony: <?php $terms = get_terms(‘productcategories’); foreach ($terms as $term) { $wpq = array ( ‘taxonomy’=>’productcategories’, ‘term’=>$term->slug, ‘order’=>’asc’, ‘orderby’=>’title’); $query = new WP_Query ($wpq); echo “$term->name:<br />”; ?> <?php if ($query->have_posts() ) : while ($query->have_posts() ) : $query->the_post(); … Read more