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