$args = array(
'type' => 'post',
'hide_empty' => 0,
'hierarchical' => 1,
'taxonomy' => 'category',
'pad_counts' => false
);
$categories = get_categories($args);
foreach($categories as $category) {
echo '<tr>';
if($category->parent != 0){ // If this is a subcategory
echo "<td> $category->name</td>";
} else {
echo "<td>$category->name</td>";
}
echo "<td><input type="text" name="$category->cat_ID"/></td>";
echo '</tr>';
}
Related Posts:
- Can I set a default featured image for a category?
- What’s the URL for a category archive?
- Weird behaviour when adding terms/term_taxonomies programmatically
- how to use a different domain/subdomain for authors/catagories on single site?
- Category count inside the link
- Is there a way to have duplicate category slugs?
- Multiple level category drop-down
- WordPress Ordering Problem. How to fix ordering 1-10-100 issue?
- how to show posts of category random by session
- Remove “Parent” Selection When Adding/Editing Categories?
- WooCommerce change category url and product base
- How can we get Catergory / Term Creator
- Seperate WordPress catagories into sepeat list on seperate pages
- Redirect category to first available child post
- Show post only if match all categories
- Output link to category from WP_Query loop of woocommerce products
- How to get product count with respect to categories in WooComerce
- Password protect a specific category page/post
- Different excerpt styles per category, but chronological
- Show only one category
- Pagination Not Working on Category.php page
- Display WordPress Parent Categories Only?
- Filter Home Page Posts in Buddypress [closed]
- Broken category pagination
- Additional featured post on first page
- Color different for the current category
- Displaying a full post instead of a slug per category?
- one category template for multiple categories
- How can I define a custom archive for childs of a specific category?
- How do I toggle pagination on/off in search results and category listings via a link?
- Category shows only top level child categories
- get_categories() returns “Uncategorised”
- How to show WordPress parent and child category using a different template?
- How can I get categories IDs if multiple categories requested via URI?
- List categories with custom code
- Page display certain Category Posts
- REST API: Display Category names in JSON?
- WordPress for Podcast Network
- Categories widget show empty?
- Where is the category of a post stored?
- Exclude a category from a query that includes its parent category
- Count the posts number for every category
- Add image to each podcast series (or category) in headless WordPress instance [closed]
- How to define multi categories posts number
- Trying to get variables in hacked category dropdown
- how to separate categories in loop.php?
- Change of category structure will cause two kinds of URLs for one post
- Portfolio Filter Buttons Wont Work
- Insert HTML content in WP Query at specific point
- Get Meta Keys of Custom Categories
- Change slug of Standard wp Post category
- Get posts of a custom post type from category from taxonomy?
- How can I ask to an existing category?
- Hide a category of posts from main blog, and only show in category view
- ACF no print data [closed]
- Change categories count to include media attachments
- How to Sync Menu, Widgets and other masters from Main Website to its Sub Site
- Show category meta in loop on homepage
- Get the name of category in query
- Archive filtering
- How can I check which archive has referred the single? [closed]
- How to hide widget from certain category
- Split multiple categories into two columns
- Add custom categories and subcategories and posts as custom pages
- pagination 404 error, same slug home and categories
- How can I order all subcategories alphabetical independent of the parent categories?
- Automatically add custom taxonomy to posts in a category
- Linking to the most recent post in my podcast category
- How to select a parent category and show the children to choose in another select?
- Subcategories in Category Page
- WordPress Portofolio Conditional Templating – functions php
- Category page 404s on mobile but not desktop?
- I want to create a custom taxonomy page showing a list of subcategories
- How can I display categories on different pages
- How to add excerpt and read more button to category archive page
- How can I restrict the categories users can post in, based on user roles?
- How to define a post category undeletable by other users?
- Icon images across multiple categories
- Is there a way to order categories?
- Categorizing Just Imported Posts
- Post url rewriting for posts with certain category
- wp_category_checklist won’t show up for non-admin users
- How to make all post in to a category?
- In a shared site, how to get products in a category from one site to another?
- Adding a button to a product if it’s in a category, then linking to that category
- Lowest catagory link
- Automatic menu creation for pages with categories?
- Displaying posts from a Category where the Category ID or slug is not known
- Custom CSS to resize elements in multiple categories
- Show posted on date only for posts in a certain category
- Page redirecting to category (IE only)
- Using pagination with multiple loops causes it to break
- get latest post in category date
- How to make wp dropdown category load with selected option on top?
- Multiple Parent Category URLs
- get posts from 2 categories. (2 posts)
- How to add location as category?
- Converting Categories (with ACF fields) to custom taxonomies
- Why does my WordPress index has a category?
- Taxonomy term RestApi data 10 rows limitions