Hello i have created taxonomy in custom post type that act like category.
then i have created terms that acts like categories.
i have create widget that show all terms from taxonomy. all works great.
but i can"t understand how to limit the number of terms to show.
i have created input in my widget. so if i put some number i want the widget will limit to show only this number of terms.
thanks for help!
the code to show all terms is:
$terms = get_terms('new_category');
echo '<ul>';
foreach ($terms as $term) {
$term_link = get_term_link( $term, 'new_category' );
echo '<li><a href="' . $term_link . '"><div>' . $term->name . '</div></a></li>';
}
echo '</ul>';
get_terms
? – Milo Sep 10 '13 at 18:37