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;

Shouldn’t this be easy?! Custom post type/custom taxonomy permalink

Follow the advice on this question as you did already, but add this to your code: add_action( ‘generate_rewrite_rules’, ‘fix_literature_category_pagination’ ); function fix_literature_category_pagination( $wp_rewrite ) { unset($wp_rewrite->rules[‘literature/([^/]+)/page/?([0-9]{1,})/?$’]); $wp_rewrite->rules = array( ‘literature/?$’ => $wp_rewrite->index . ‘?post_type=literature’, ‘literature/page/?([0-9]{1,})/?$’ => $wp_rewrite->index . ‘?post_type=literature&paged=’ . $wp_rewrite->preg_index( 1 ), ‘literature/([^/]+)/page/?([0-9]{1,})/?$’ => $wp_rewrite->index . ‘?literature_category=’ . $wp_rewrite->preg_index( 1 ) . ‘&paged=’ . … Read more

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