I have a custom taxonomy/terms named “Cast”. And it may contain lots of names sometimes even over 50 and it consume too much space of the theme.

enter image description here

Is it possible to limit the maximum terms displayed in post?

For example the limit is 15 names from that taxonomy so it only shows 15 and hides all others.

1 Answer
1

As per the wordpress documentention, you can limit the showing terms by number.
https://developer.wordpress.org/reference/functions/get_terms/

$limit_terms = get_terms( 'Cast', array(
        'orderby'    => 'count',
        'hide_empty' => 0,
        'number' => 50

    ) );

Leave a Reply

Your email address will not be published. Required fields are marked *