Get all posts for custom taxonomy term

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

get taxonomy list in a page in the wordpress

The functions such as get_categories are unique to the post category taxonomy. “Category” is a taxonomy term. If you register your own taxonomies, you need to use get_terms which has similar parameters to your get_categories function. $terms = get_terms(array( ‘hide_empty’ => false, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘taxonomy’ => ‘your-taxonomy’ ));

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