You can use this function:
the_widget( 'WP_Widget_Categories', 'dropdown=1&hierarchical=1' );
This function give you a select box and you will get all the parent categories and sub-categories. After applying this code inspect category select box, then you can manipulate your HTML code. And show your category as you wish.
If you don’t want any select box, then you just remove "downdown=1&"
. This will give you a whole list of all categories and sub-categories. After applying this code inspect category select box, then you can manipulate your HTML code. And show your category as you wish.
Hope this will help!
Related Posts:
- Redirect to another page using contact form 7? [closed]
- Display posts by alphabetical order
- Category archive in menu
- Make a Custom template for a specific category in wordpress
- How to make horizontal scrolling menu [closed]
- Assign post format to categories
- Creating a nav menu
- Using WP Category Lists Plugin to Dynamically Display Category (PHP)
- Calendar Solution: Handling upcoming Dates with Posts?
- Events Plugin that works with existing categories?
- Excluding a category from wp_query breaks recent post widget
- Trouble with editing template for “List category posts” plugin
- Any built-in function to associate a post to category through a plugin?
- Easiest way to add dropdown to a page
- How to get the element ID from new menu list that added with add_filter()?
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Display by Category in Admin
- Search for categories
- Merging Two menus in the backend into one menu
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- Customize permalink wordpress category id
- Delete mobile menu button [closed]
- html generated by theme exist but doesnt appear in browser
- Automatically Assign Author to Category [closed]
- Custom Pages for Woocommerce Product-Category Pages
- Changing page URL and connect newsletter to MailChip
- polylang + category/tag custom language link
- How to password protect a category page / not posts?
- Dynamic admin submenu
- Center and hide overflow of WP toolbar custom links
- How to remove admin main menu name repetition
- How to display taxonomy images with wp_list_categories?
- Using arbitrary paths in page urls
- Custom Permalink Plugin and Current Page/Ancestor in Menus
- wp-custom-menu filter removes the current_page_item class
- WordPress “Categories to tags converter” not working. Pointing to import.php instead
- How do I apply style to each category of a list?
- add_action does not call the function
- How to use my menu PHP code as sidebar?
- Recent posts per category loop?
- Hide a Menu Item on Login
- How to get menu location in wp_update_nav_menu hook
- PHP script from functions php is loaded via admin-ajax to div…and the result is 0, not the desired content
- How do I rename a category in the menu bar only?
- Ambrosite Next/Previous Post Link Plus or WP next_post_link to cycle through top level category
- Is changing post from category in a large blog a good practice?
- Best/Correct way to add an option to a category
- How to set category correctly for a custom post created by a remote API call?
- Progmatically adding menu links to the default (Top) or Footer menu
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- .php file for woocommerce edit category? [closed]
- check uncategorized category by default
- Changing location of “About me” section
- Need to revert to an older version of wordpress
- Mutliple users editing single document in wordspress
- WordPress Custom Menu Admin helper plugin
- How to add category and subcategory in WordPress custom code?
- How can I add a fixed vertical menu to my site? [closed]
- 2 wordpress site same database
- Hook on creating a menu entry?
- WooCommerce Hiding A Certain Category From Being Displayed On Single Product
- How can recognize post’s category?
- How can i listing current category and Featured Category post list?
- Dropdown menu on click change
- Categories from front-end, checkbox selection doesn’t work
- navigation among single posts
- How to add character to content of post?
- Editing “Kahi’s Highlight Used Categories” plugin code – highlighting parent and child category in post page
- single.php fires more than once after clicking on any post to view with different post id each time
- How can I add the custom taxonomy categories to the posts and pages?
- How to activate/deactivate menu tab and keep the same id?
- Twitter List Tweets and Delicious Links as Posts
- Display static pages instead of category, in code
- WordPress “Categories to tag converter” not working on imported Blogger posts
- wp_insert_post_data filter to set category
- What happened to WP No Category Base?
- How can I add different menus (different style menu) on each page?
- 404 not found problem with URL rewrite custom category
- Is there a way to combine categories and their hierarchy into the admin listing page?
- Automatically set posts to NoIndex depending on category?
- Save post to category with gravity forms (post_data) [closed]
- formatting the way posts show up
- How can I create a navigation menu in the sidebar that can also act like a slider?
- Call to a member function get_page_permastruct() on null
- Automatically put a menu on every post
- How to validate password length in wordpress
- Why plugin’s icon for the menu not found?
- woocommerce retriving category name as div class?
- query_vars in plugin when using custom permalinks
- Plugin: Custom menu item problem
- How to pre-set WordPress settings for specific posts?
- hide particular category post from front page only [closed]
- Is it possible to know which menus are owned by a plugin?
- My wp_update_nav_menu action is firing twice
- Create WordPress category dynamically
- Can i have limit posts on a specific category and automatically remove older ones?
- How to check if the Menubar contains no items?
- How does one add numbers to an admin menu?
- Categories not showing when all of the posts are private
- Adding fontAwesome to Primary Menu returns after saving the menu