I'd like get_the_category_list to only display one or two categories instead of all the categories associated with the post. Haven't been able to find any results.
<?php echo get_the_category_list(); ?>
Any help would be appreciated
|
I'd like
Any help would be appreciated |
|||
|
|
|
Quick idea would be to pass some simple separator like comma and cut from the start of result till it. But I think that if you want better control on output it would make more sense to use level deeper |
|||
|
|
|
If you want to limit For example if you want to limit echoing a category + link to show say only 5 categories.
|
|||
|
|
|
This worked. Found in http://codex.wordpress.org/Function_Reference/get_the_category
|
|||
|
|