WordPress.org

Ready to get started?Download WordPress

Forums

get_terms('category') doesnt work (1 post)

  1. mariazapata
    Member
    Posted 2 years ago #

    Hello,

    I am trying to display the categories with the get_terms function with the following code:

    $categories = get_terms( 'category');
    						$categories_count = count($categories);
    
    						for ($i = 0; $i < $categories_count; $i++) {
    							echo($i . $categories[$i]->name.' <br /> ');
    						}

    But for some reason doesnt display all the categories, a couple of them are missing uncategorized and something else, this is what I see on the screen when i run this code:
    0Chairs
    1
    2Interiors
    3
    4Featured

    Thanks very much,

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags