How to Reverse Taxonomy Order

You can do this with the pre_get_posts action. pre_get_posts fires after the query variable object is created, but before the actual query is run. So you won’t suffer performance penalties by running multiple unnecessary queries. In your functions.php: add_action(‘pre_get_posts’,’xx_taxnomy_query’); function xx_taxnomy_query($query) { if ($query->is_main_query() && ! is_admin() && $query->is_tax(‘your_taxonomy’)) { $query->set(‘order’, ‘asc’); return; } }

Checking if a Page has an Associated Term?

Hi @NetConstructor: First thing, assuming your logic worked you can use the ternary operator to simplify your example: <li id=”kids-<?php echo is_term(‘Kids’,’age_groups’) ? ‘on’ : ‘off’; ?>”>Kids Programs</li> The issue seems to be that is_term() is used to check if a term exists, not if it is associated with a particular post. I think what … Read more

pre get posts changing the query

Try using meta_query parameter : add_action(‘pre_get_posts’, ‘add_event_date_criteria’); function add_event_date_criteria(&$query) { // We only want to filter on “public” pages // You can add other selections, like here: // – Only on a term page for our custom taxonomy if (!is_admin() && is_tax(‘event-tag’) || is_tax(‘event-category’)) { $time = time(); $meta = array( array( ‘key’ => ‘start_time’, … Read more

Custom taxonomy parent from another taxonomy

I was searching for an answer of the same question, and found a question on SE, that contains the answer: https://stackoverflow.com/a/40868654 In WordPress 3.7, released in 2013, a filter was added that allows manipulating the arguments, used to get the list of terms for the parent dropdown. The filter was also applied on the edit … Read more

Creating a function that receives the taxonomy terms that have been changed in a custom post type

After WordPress has updated a posts’ taxonomy terms it triggers the action: set_object_terms (see source) which passes 6 variables: Object ID Terms that were assigned to the post (or added depending on 5) (could be their slug or term ID). Taxonomy-term IDs of above (not term IDs) The taxonomy Append. If true – terms in … Read more

Advanced custom fields – taxonomy terms images [closed]

OK had a go at this myself, I didn’t realise ACF was able to add fields to taxonomies which is really handy so I wanted to figure it out too. <?php $libargs=array( ‘hide_empty’ => 0, ‘parent’ => 0, ‘taxonomy’ => ‘library_categories’); $libcats=get_categories($libargs); foreach($libcats as $lc){ $termlink = get_term_link( $lc->slug, ‘library_categories’ ); ?> <a class=”single-library-cat” href=”https://wordpress.stackexchange.com/questions/71287/<?php … Read more

custom post type category page

Since you are using a custom taxonomy and not the native post categories you need to name your file taxonomy-{taxonomy}.php and in your case it would be taxonomy-mycategories.php Take a look at the section of the template hierarchy to display custom taxonomy archives.