This function returns all categories as an array of the current post or page or the designated post or page.
Parameter | Details |
---|---|
$id | (int) (Optional) default to current post ID. The post ID. |
Please note that get_the_category() returns an array, which means that you can't directly echo the value returned.
Here is a list of objects of each category that you can print: