taxonomy terms, inverted

yes it’s because you sort them by name and in order ASCending. because ‘orderby’ => ‘name’, ‘order’ => ‘ASC’ is the default setting. try: $term_names = wp_get_post_terms($post->ID, ‘marcamodelo’, array(‘fields’ => ‘names’, ‘orderby’ => ‘name’, ‘order’ => ‘DESC’, )); and it should be the other way around. here you have documentation of which parameters are possible … Read more

Get Term ID by Description

I’m not aware of ready-made functions that support this, but you can easily construct a WP_Term_Query to do this. The following code is untested but should work: $args = [ ‘description__like’ => ‘the description you\’re searching for’, ‘taxonomy’ => ‘category’,//or other taxonomy ‘fields’ => ‘ids’, ‘hide_empty’ => false, ]; $term_query = new WP_Term_Query($args); foreach ($term_query->terms … Read more

show recently added tags to tag cloud

I don’t believe you can do this with the default tag cloud. The only options for ordering are “name” and “count”. You would need to add a new term to order by and probably use date. See this post’s answer for more details.

Add pagination to for each taxonomy terms

That pagination is for posts, whereas you are trying to paginate terms. One approach is to create the pagination for yourself: $term_id = $term->term_id; $taxonomy_name = $term->taxonomy; $termchildren = get_term_children($term_id, $taxonomy_name); $per_page = 10; $page = get_query_var(‘page’); $paged = get_query_var(‘paged’); $total_pages = ceil(count($termchildren) / $per_page); $current_page = ($paged ? $paged : ($page ? $page : … Read more

How to show children terms even if they are empty

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

I want to change the slugs of my terms dynamically

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

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