http://codex.wordpress.org/Function_Reference/get_categories
example:
<?php
foreach(get_categories('parent=0&orderby=id') as $cat) {
echo $cat->term_id.' '.$cat->name.'<br/>';
}
?>
Related Posts:
- How to display non-hierarchical taxonomy as terms with checkboxes?
- Make parent categories not selectable
- Reflect nested categories in appearance > menus
- How to show posts of an columnized different categories on the same line or row?
- Echo one category as title when post has multiple categories?
- How to Override default update_count_callback for category
- I use same slug name for category and page
- On Category page, How can I get the category ID?
- How to order categories in Woocommerce that are spread over multiple pages? [closed]
- Order Taxonomy Term by date created
- How do I display the posts from a custom post type on a category.php page?
- Let visitors post comments on category page
- category_description() shows raw html after version 3.x?
- Automatically add product_categories to nav_menu
- Add Product categories to WordPress menu without losing hierarchy
- Make parent category not selectable when it has child categories
- Can I use get_adjacent_post for specific categories?
- How to change number of items on add new pluggins page from backend?
- How to Filter categories in the permalink structure
- Accessing WordPress MySQL Database via Data Connection in Visual Studio 2010 using C#
- How to display posts under a specific subcategory of a given category
- Ignoring a category in WP_Query still shows the links in next_post_link()?
- Implementing a tricky wordpress menu (nested categories + thumbnails)
- products nested by subcategories in a current category archive
- get_the_category() always returns empty array
- Post count for category and tag
- Get current_parent_category in a loop or Cat ancestor- big problem
- Show number of articles in menu
- Can you pre-check wordpress categories?
- If posts category is “cars”, display image
- Is having thousands of unique categories a concern?
- How to prevent parent being choosen in wp_dropdown_categories
- query in category.php repeats itself
- How can I add more “filters” to my products? (Categories, attributes, etc.)
- Remove product category placeholder image (Woocomerce)
- How to “group” (categorize) the Pages together?
- Is There a Difference Between Taxonomies and Categories?
- Style category link depending on category ID
- Custom Walker for wp_list_categories
- How to insert category list into post creation page, and retrieve chosen categories?
- Related Tags not in category
- Output category color option to each li item
- How do I display only two categories Instead of displaying all categories
- Hooking to walker_nav_menu_start_el to insert list of subpages
- Show the latest post from child category?
- Having problems with paging
- How do I add a tag slug to a category URL to filter posts?
- How to show a list of only categories (exclude subcategories)
- Dropdown menu for subcategories
- How to add categories on a page [duplicate]
- Adding custom ID field to the categories
- How to hide some categories in dashboard
- Child Category Conditional Question
- Getting the first parent of a hierarchical term
- get category name in admin screen
- Return category posts with WP_Query
- Include either name or slug in the include parameter using wp_list_categories?
- get cat id is not working from custom taxonomy
- How to add image for all posts associated to specified category?
- Show the current post’s category, without displaying parent category
- get all categories’ latest post in one query
- Include specific category in URL automatically
- WordPress Category Page Layout
- get_the_category – display only a single category for a post (not all categories)
- display category with background color
- WooCommerce Product category can be shown with multiple related URLs
- Categories are not available AT ALL under Menus
- change image on single product page with js
- How to get all post categories without custom post type categories?
- Display menu in category and sub category
- Displaying a Category on a WordPress Page
- Show alternative menu based on page template AND post category
- Display Category yearly wise in wp
- Get all subcategories IDs from categorie or categorieIDs
- Redirect category archives to pages
- How to create a category loop on my blog (ACF Plugin)
- Using heirarchial tags or Custom taxonomies
- On main page, in each post, display image depending on post category
- Get posts base on category ratio of more then two categories
- Images appear in the header on all pages, but not category.php
- Change single.php template based on parent category
- WordPress and “pretty permalink”
- Custom file with special code of category widget
- New Category – custom taxonomy
- add custom option to get_categories dropdown
- Category as subdomain
- Using categories and pages in menus
- Gettind 404 not found wen click the view button for a given category custom post type portfolio
- list first post of Child Category on Category page
- Use get variable when rewritten url in wordpress
- Create custom Perma link
- Display post of current parent category, and in right hand side show child category post
- Category pagination not working in category.php please help me
- Print the associated categories of the current post starting with parent (with option to remove href)
- Add product category to post_class
- Moving Blog and Changing URL
- completely confused with archive.php, category.php
- hide_empty property not working when using get_terms
- Category Redirection Problem
- Hierarchical outline of posts