How to modify custom category field from front end?
wp_update_term does not support custom fields so you will need to use update_term_meta instead. update_term_meta($personid, ‘_dob’, $_POST[‘newDob’]);
wp_update_term does not support custom fields so you will need to use update_term_meta instead. update_term_meta($personid, ‘_dob’, $_POST[‘newDob’]);
I think you are using the tax query in wrong way. Please use ‘tax_query’ => array( array( ‘taxonomy’ => ‘$term->taxonomy’, ‘field’ => ‘slug’, ‘terms’ => ‘$term->slug’ ) ), instead of ‘taxonomy’ => $term->taxonomy, ‘term’ => $term->slug, It will work fine.
If you want to use the filter on the archive page then you have to get the second term id by using the global variable or by passing the hard value of the term id. But if you are using the filter on any other page then you can send the term id through post … Read more
If you only need to display posts assigned to a taxonomy (just a list of posts from each term in your taxonomy without displaying term information) Get only terms IDs: $custom_terms = get_terms( array( ‘taxonomy’ => ‘how-to-guide-type’, //your taxonomy ‘hide_empty’ => true, //ignore terms without posts ‘fields’ => ‘ids’ //return only terms ids )); Now … Read more
Ok, I think I got it! 😀 After some research in theme functions how taxonomy hierarchy structure is done I modified the code as below (don’t know if it’s coded good but it works): /* * Display filter taxonomies */ static public function taxonomy_listing( $name, $terms, $taxonomy, $selected_term, $hide_empty = false ){ $search_more_less = adifier_get_option( … Read more
You can put svg text right in the prev_text and next_text. To make it a little more readable here I’ve broken it up and prepared the SVG markup first. I am only show you the “prev” link but the “next” would work the same way. $prev_label = “<span class=”cover–nav-label”>” . _e(‘Recette précédente’, ‘marque’) . “</span>”; … Read more
Yes, you can. get_terms function takes $args as first param. And you can use the same args as with WP_Term_Query. Two arguments that may interest you are: child_of – (int) Term ID to retrieve child terms of. If multiple taxonomies are passed, $child_of is ignored. Default 0. parent – (int|string) Parent term ID to retrieve … Read more
As far as I got you right, the following code is all you need to solve this. function my_function( $post_id ){ if ( ! wp_is_post_revision( $post_id ) ){ $post = get_post( $post_id ); $my_args = array( ‘ID’ => $post_id, ‘post_name’ => ” ); // unhook this function so it doesn’t loop infinitely remove_action( ‘save_post’, ‘my_function’ … Read more
I think that problem is at array_push($AutoComplete[$value->taxonomy] = [$value->name]); Can you replace it with this code and test once? $AutoComplete[$value->taxonomy][] = [$value->name];
WP_Term_Query, which powers get_terms(), does not support ordering by multiple properties the same way WP_Query does. But, since you don’t need to worry about pagination, you’ll be able to achieve the result you want by sorting the results after querying them: $allcities = get_terms( array( ‘taxonomy’ => ‘city’, ‘hide_empty’ => false, ) ); usort( $allcities, … Read more