Please try to use this function
https://codex.wordpress.org/Function_Reference/wp_dropdown_categories
wp_dropdown_categories() – Display the HTML dropdown list of categories
<form id="category-select" class="category-select" action="<?php echo esc_url( home_url( "https://wordpress.stackexchange.com/" ) ); ?>" method="get">
<?php wp_dropdown_categories(); ?>
<input type="submit" name="submit" value="view" />
</form>
Related Posts:
- WordPress Multisite – global categories
- Get posts from sites in Multisite?
- Retrieve Product category ‘NAME’ by product category ID – WooCommerce?
- Can’t custom taxonomies have same terms (slugs) as categories?
- Using wp_category_checklist in a widget
- How to show subcategories in categories else show posts
- How to remove the parentheses from the category widget
- Filter front page posts by category
- How to get the url to tag & category base set by the user?
- Exclude one category from get_the_term_list
- WordPress remove separator from last item in wp_list_categories
- Need help adding custom field to category
- How to: 301 Redirect /category/ to /customname/
- How to Include the Parent and Child Category in the Permalink if the Post is Added to Both
- Root level category, tag, author and archive pages to work
- Number of posts in page – set per category and exclude sidebar
- Create single.php for specific category by category id
- Display one latest post from multiple categories
- Archive pagination causing 404 with permalinks structure
- Use get_term_children to get the sub category of a parent category for the current post
- How to make all posts in a category “unsticky”?
- Get a list of Terms for a specific category
- Get a variable from object in array [closed]
- How to stop wordpress from showing the selected category on top of others in the category selection?
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- advanced custom field Show field in special categry page [closed]
- How Do I Merge Categories With phpMyAdmin
- Exclude Child Categories Using wp_list_categories
- Edit the markup of categories list
- Show category children, one level
- a-z list, categories and sub categories in loop
- Category slug $_SERVER[‘REQUEST_URI’];
- wp_dropdown_categories and custom taxonomy + custom post type
- How do I get a list of all categories that a given user has written blog posts for?
- Linking products to categories
- How to remove “Category : …”
- Show all posts for a specific category/author
- Add “page-a” slug to category link if user visit category link from “page-a”
- Resort get_categories
- How to call custom category field data in theme?
- Query Posts Exclude Entire Category
- One Specific Category To Permalink
- Hide woocommerce category name from specific pages
- select parent category first then child
- WordPress category widget only show categories with children
- Woocommerce custom category page with pagination [closed]
- Menus don’t work after 4.4 [closed]
- Custom post and category template pagination problem
- Multiple category selection in post, shows less important category in breadcrumb
- I want to display the all the posts that are inside a certain subcategory
- How to list all categories in three divs dynamically based on the quatity of categories?
- Grouping categories by genre
- how to “not” display new posts with a specific category on the main page?
- Category template with pagination returns 404 on next pages
- Limit categories and it’s subcategories for specific group of users
- show all WordPress categories in a page
- Ive got a term (get_term_by) but now I want to filter it by a category it is in?
- Category specific order
- Problems with my conditionals in single.php by category
- Recent post by custom select query
- WP_safe_redirect not working
- Do not show sub categories in the loop on archive-product.php
- Having a template per category? Bad for server overhead?
- Add custom code at start and end of all posts in a category
- Group search results by category
- Anchor tag generates blank href attribute using echo esc_url( )
- WordPress monthly archive category specific
- Get categories related to particular category
- Exclude the category of the current post
- Output Title of Post’s Current Category
- Related Post by category, but not current category child
- Displaying posts of given category
- Location Based Permalink
- get list of category from a specific post with get_term()
- Return all Tags and Categories in Separate List
- Featured Category or Special Category in WordPress
- How to show given products only using product id array from specific category page in woocommerce
- Ordering terms whilst in loop
- How to list all categories a post is in, but exclude current post´s category on single post page
- Get only children category name
- No results found for second level category
- get_the_category vs wp_get_post_categories
- Categories in media library
- WordPress Shop and restricting products and categories for some users/groups
- Pass list of categories to JS
- WP_query exclude a category unless it has more than one catagory
- Paginating a list of all posts collected by category titles
- Customize category query in widget
- Page permalink rewrite
- Narrow Down a Shop Page Results Based on a Product Tag in WooCommerce
- How to control order when displaying child categories
- Broken category styling
- Trying to WP_Query a category
- Woocommerce Force the category choice before creating new product? [duplicate]
- How to get specific number of category post on a page or category page?
- Use same wordpress category base and tags as the prefix as the post permalink
- Display different sidebar based on search results from one category
- Adding category to existing post (uploaded file)
- how to create a page that shows all of multiple category posts on a single page
- Quick Edit on taxonomy names results in error