Support » Fixing WordPress » PHP help for get_the_category

  • Hi

    I have problem with get_the_category. How to order categories?

    I try to put this code above my thumbnails.

    <?php
    $category = get_the_category();
    echo $category[0]->cat_name;
    ?>

    My problem is with categories order. I want to show subcategory.

    Here is example:

    Thumbnail 1 Shows me the 2nd category of post
    Thumbnail 2 Shows me the 1st category of post
    Thumbnail 3 Shows me the 3rd category of post

    I changed everything but is not working.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP help for get_the_category’ is closed to new replies.