• How can I show 1 random category and extract the image from the category description and show as a thumbnail?

Viewing 1 replies (of 1 total)
  • use get_categories to get an array of categories may solve the problem.
    You could take a look on this page: get_categories

    <?php
    $cats = get_categories(/* input params as you like */);
    $randomCate = $cats[rand(0, count($cats)-1)];
    ?>

    you may try print_r($randomCate) to see the structure of it, which is also an array.

Viewing 1 replies (of 1 total)
  • The topic ‘Random category’ is closed to new replies.