You can use the function wp_dropdown_categories()
instead of wp_list_categories()
, if you dont need to use the list function.
wp_dropdown_categories()
seems to be working just like the list function. So first just try and replace these two functions.
$terms = wp_dropdown_categories( array( ...
Read about it in the codex here.
Related Posts:
- Replacing the NavWalker dropdown element
- Custom Loop through category menu to include sub categories
- Filter Select results based on selection
- How to pick the default selected value in wordpress dropdown?
- how to save selected option in variable for rest api category filter
- How to use wp_nav_menu to create custom dropdown menu?
- go to home page when i select default in select-box
- Dropdown category field inside repeatable metabox
- How to list categories by page id in wordpress
- Open WordPress Page from selected option dropdown
- Can’t assign menu parent id or menu item breaks
- Change list item content in menu navigation to add a child element with specific class
- Proper syntax or method for keeping url in modified isotope / category links
- Menu Limitations
- How can I Add a variable PHP in the Menu Nav
- Where to place PHP code that inserts (or doesn’t insert) menu item?
- What is an equivalent of single_cat_title for getting the slug of the category?
- Issue adding sub category programmatically
- Adding an Avatar to the Top Nav Bar
- Easiest way to add dropdown to a page
- Automatically adding new post categories to menu
- Add data attribute to each li in menu
- How to exclude category ID from Looper in WordPress
- Add a specific part of current category page url to shortcode
- how do I get a specific post from a post with a subcategory in WP
- WP grandchild categories in nested ul li
- Grab posts by multiple categories
- Pass Category Name, Description and Photo into variables to pass to jQuery
- How to show single category archive
- Move category description below post list in blog
- Remove metabox from WordPress menu editor page?
- Applying A Category to Existing Posts Where Page Title Matches Regex
- Get page that displays all children of taxonomy parent
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- How to add an arrow to menu items has submenus
- wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu
- selected option if current category is the value
- Unique icons next to each WordPress menu item
- get_template_part based upon post’s category
- Child page menu in sidebar
- Title Case WordPress Menu Items
- Setting default category base on theme activation
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- Hide subcategories (widget)
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- Alert Bar section within WP loop is displaying even though there are no posts
- Let Users Choose Post Categories
- Different post styles depending on category
- Display category name only once inside loop
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- Display parent and child taxonomies in separate drop down select fields
- Trying to store submenu items to render out after main menu
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- How to change menu order item
- How to show only subcategories in parent category not parent category?
- Custom Menus: dynamic highlighting problem with custom home link
- get_the_title() gets printed out twice
- how to show only specific category for a template
- Redirect to another page using contact form 7? [closed]
- wp_dropdown_pages auto submit
- Dilemma of Populating all the categories in a drop down list
- Add item to top of menu using a filter in functions.php
- Display most popular posts of category
- Adding PHP in the menu
- Two menus show up
- Create menu locations for each category in wordpress
- Creating sub-categories via php
- Define specific category name in PHP
- Edit the_category (); for a hierarchical display
- JSON REST API WordPress only showing first 10 categories
- Category title output before opening title tag
- get taxonomy thumbnail and use it as a variable in code
- Include Parent Term in wp_list_categories
- Register a menu – Error Header
- How to style one item from main navigation?
- How to array only one key from another array
- Show About and Contact Us page when they’re clicked in the top menu.
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- New walker for walker_nav_menu to change inside container data
- Add data-id attribute to child page links
- Parsing Menu Items and Blog Posts
- Get all categories post is not in
- Get latest post from all categories except one
- Add login hyperlink to secondary navigation menu
- Displaying posts based on category
- How do I remove a category from a wordpress loop>
- Isotope Drop Down Categories Filter Function
- Get categories names as an array to use it in theme settings
- Automatically add images to a menu
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- How to get the last category name of a child category?
- In WordPress, how do I get the number of posts next to single_cat_title(”); in the category.php file?
- Use get() method to grab all categories and output inside another method
- Add value to new attribute inside WordPress menu items
- Only show size attributes in product box woocommerce when available
- wp_nav_menu not working correctly in my underscores theme
- How to get category name or ID by post?
- Custom post type category not displaying category ID
- Argument for if term-> have child?