WordPress taxonomy radio buttons

However, this will turn ALL terms checkboxes to radio buttons. Not only that, it’ll turn any checkbox in a meta box – not ideal! Instead, let’s specifically target the wp_terms_checklist() function, which is used to generate the list of checkboxes across the admin (including quick edit). /** * Use radio inputs instead of checkboxes for … Read more

Check if Current Category has Children

There may or may not be a better way to do this, but here’s how I would do it: $term = get_queried_object(); $children = get_terms( $term->taxonomy, array( ‘parent’ => $term->term_id, ‘hide_empty’ => false ) ); // print_r($children); // uncomment to examine for debugging if($children) { // get_terms will return false if tax does not exist … Read more

Get term name from term ID?

The function get_term_by() would allow you to get the taxonomy term name from the id. $quantityTermObject = get_term_by( ‘id’, absint( $quantityTerms ), ‘quantity_category’ ); $quantityTermName = $quantityTermObject->name;

Is ACF being a honey trap? [closed]

Few months ago @tom-j-nowell (one of the mods here) wrote an article explaining the issues with the abuse of meta queries by many WP plugins: https://tomjn.com/2016/12/05/post-meta-abuse/ Among other things he says there: […] sites have been brought down by this, and it’s the reason a number of popular plugins don’t scale to high traffic […] … Read more

Get term SLUG by term ID

I have bit of trouble understanding your question. Taxonomy (like category) slug or term (like uncategorized) slug? get_term_children() works with terms so I will stick with that. Try this: $term = get_term( $id, $taxonomy ); $slug = $term->slug;

How to only list the child terms of a taxonomy and not their parents?

This should work for you: $taxonomyName = “age”; //This gets top layer terms only. This is done by setting parent to 0. $parent_terms = get_terms( $taxonomyName, array( ‘parent’ => 0, ‘orderby’ => ‘slug’, ‘hide_empty’ => false ) ); echo ‘<ul>’; foreach ( $parent_terms as $pterm ) { //Get the Child terms $terms = get_terms( $taxonomyName, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)