How to limit custom post category

Use array_slice and get the first 5 elements of the array: <?php $term_id =182; $taxonomy_name=”geram_category”; $term_children = get_term_children( $term_id, $taxonomy_name ); $term_children = array_slice( $term_children, 0, 5, true ); foreach ( $term_children as $child ) { $term = get_term_by( ‘id’, $child, $taxonomy_name); echo ‘<li><a href=”‘ . get_term_link( $child, $taxonomy_name ) . ‘”>’ . $term->name . … Read more

Displaying custom taxonomy related to each post type

Try Below Code function custom_taxonomies_terms_links() { global $post, $postid; $custom_taxonomies = get_post_taxonomies( $post ); if($custom_taxonomies) { foreach ($custom_taxonomies as $custom_taxonomy) { // get post type taxonomies $args = array( ‘public’ => true, ‘_builtin’ => false ); $args[‘name’]=$custom_taxonomy; $output=”names”; // or objects $operator=”and”; // ‘and’ or ‘or’ $taxonomies = get_taxonomies( $args, $output, $operator ); $out = … Read more

Previous/Next custom post links within custom taxonomy

I managed to solve this, with some steering in the right direction in the comments under my question, by specifying different templates for different taxonomy terms using single-show.php to divert as follows: if ( have_posts() ) { the_post(); rewind_posts(); } if (has_term(‘current’, ‘show_status’)) { include(TEMPLATEPATH . ‘/single-show-current.php’); } elseif (has_term(‘past’, ‘show_status’)) { include(TEMPLATEPATH . ‘/single-show-past.php’); … Read more

Single taxonomy for different custom post types

I think this is what you are searching for… You must use both post_type and tax_query to filter your query $query = new WP_Query( array( ‘post_type’ => ‘books’, // name of post type. ‘tax_query’ => array( array( ‘taxonomy’ => ‘fiction’, // taxonomy name ) ) ) ); while ( $query->have_posts() ) : $query->the_post(); // do … Read more