Tag Info

New answers tagged

0

Following code will fetch custom taxonomies named products. Array of taxonomy object will be returned. Use foreach for loop. In the following example, taxonomy name and description is printed out. $customPostTaxonomies = get_terms( 'products' ); if ( ! empty( $customPostTaxonomies ) ) { foreach ( $customPostTaxonomies as $key => $tax ) { echo ...


0

Use this instead of wp_list_categories( $args ); wp_list_categories( $args ); It will display the category with formatted results like <ul><li> $categories = get_the_category(); This will returns the all category assigns to the current post and store in $category variable. Then you can display as in you listed format ...


0

I would use get_categories() to first get an associative array of all the categories and then sort it how you want it. $categories = get_categories('include=16,17,15');


2

So, i used this script in the end, thanks to Pieter Goosen's post Category Alphabet List Broken $terms = get_terms('anime-on-going'); if ( !empty( $terms ) && !is_wp_error( $terms ) ){ $term_list = []; foreach ( $terms as $term ){ $first_letter = strtoupper($term->name[0]); $term_list[$first_letter][] = $term; } unset($term); ...



Top 50 recent answers are included