PHP help for get_the_category (3 posts)

  1. tko4
    Posted 1 year ago #


    I have problem with get_the_category. How to order categories?

    I try to put this code above my thumbnails.

    $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.

  2. Tara
    Volunteer Moderator
    Posted 1 year ago #

  3. tko4
    Posted 1 year ago #

    Yes but how to change order of categories ?

Topic Closed

This topic has been closed to new replies.

About this Topic