This can be done easily using include
parameter. Check the documentation of wp_dropdown_categories()
. You can pass category id’s to include
parameter as a array.
<?php wp_dropdown_categories( 'include=array( 8,39 )' ); ?>
Related Posts:
- Dropdown with category selection
- Saving two categories from two dropdowns in front end posting form
- Get id of category from drop down menu
- How to add HTML5 ‘required’ attribute to wp_dropdown_categories() without JavaScripts?
- How to retain the values from dropdown category lists after wrong form submission?
- Help with multiple dropdown tags search
- How to use wp_category_checklist()?
- wp_dropdown_categories and custom taxonomy + custom post type
- How to provide value for ‘selected’ on wp_dropdown_categories() for ‘multiple’ options
- Additional form options based on category selected not working
- wp_dropdown_categories() scripts working erratically on sidebar
- How to use an array of categories as a dropdown?
- Dropdown Categories used in form shows no results when all is selected
- Trying to get variables in hacked category dropdown
- wp_list_categories walker without links on categories that have subcategories (to make a nested dropdown menu)
- Filter posts by categories ajax is showing nothing
- WordPress Customizer: Dropdown with Category output
- Filter By Category Dropdown List With Custom Taxonomies
- A dropdown with checklist
- Wp Dropdown Category Not Show Current As Title
- wp_dropdown_categories initial value
- Exclude category from drop down list form
- Trying to get categories and sub-category listing
- Get_term_meta() always returns false
- Woocommerce Category Sort Dropdown
- How to add custom option to wp_dropdown_categories?
- custom browse by
- Get category fixed in dropdown browse categories
- Categories dropdown with all values selected using wp_dropdown_categories
- add custom option to get_categories dropdown
- Taxonomy for custom post type not found
- Form Value of drop down category + Translation of ‘show option none’
- Get category ID from category slug (not working)
- Control term order on a per-post basis
- Display all posts from all categories with pagination
- Changing Top Level Items into Radio Buttons in the Categories Meta Box?
- How to create a widgetized sidebar for every category dynamically?
- Display the deepest child category from Category X (in loop)
- When using get_categories or similar, is it possible to filter results that contain certain Tags as well?
- Exclude subcategories from the url
- WooCommerce – Display product child categories from specific parent
- Select category in custom query
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Show list of categories even if they have no posts
- Search by word, category, tag, author
- How to hide certain categories in wordpress dashboard?
- How to control template resolution if both Author and Category filter in place?
- Resolved – category-slug.php not working after wordpress migration
- Get multidimensional array that reflects category hierarchy
- Single_cat_title() print the title before text
- Sort posts by post_type in category.php template
- Add Post Screen Keep Category structure
- editing fonts of category links from the_category() funtion
- Force a user’s posts category
- Style wp_list_categories
- Checking for two categories in query_posts
- get_the_categories filter returns an empty array
- Warn me about ‘uncategorized’ posts
- Why category.php throw 404 in wordpress while calling paginate_links()?
- How to get related tags based on a category?
- Show category to visitors in different name or different language without changing basic category
- How to get latest posts from each category in regular order
- Pagination for ajax category filter
- Get posts from specific taxonomy term
- limit a list of tags to one category [closed]
- How many categories can WordPress handle before performance suffers?
- WordPress Drop down category as array for using in page builder
- Get sort order of product categories
- how to wordpress When I click on the category link, subcategories appear
- How to do paging in the loop?
- query_posts not reading correct categories
- Displaying list of subcategories and not parent category
- Linking doctors posts to specific services for a medical practice
- Eliminate word from $term->name
- Showing HTML if Post is In Certain Taxonomy Term
- Category view with contents of [gallery]s shown
- Can I prioritize post categories for choice for breadcrumb trail?
- Category List with custom urls
- Get a list of all links on a page?
- Load the last post of a category
- create function to call category name and slug
- Disable Category Taxonomy
- A different permalink structure for different categories
- How to make product image inherit from category image
- Is it possible to set up blog categories without changing permalink structure
- How to display categories image in loop homepage WordPress
- how to give different template to each subcategory from same parent category?
- No hierarchy in wp_list_categories with child of and depth
- Add subcategories posts to the counts column at the admin’s categories list
- global categories – Share specific categories in wordpress multisite
- WordPress update 4.7 – the 70.000+ news posts became “Uncategorized”
- Choosing different templates for categories
- Problem with wp_list_categories
- Display one post on category.php: Wrong featured image
- Changing Permalinks for Category Pages Only
- date.php shows all posts. how to fix it?
- How can I get this code to only output one link?
- Sorting Woocommerce products by category and attributes
- How to get Woocomerce categories count
- show posts from some category and sort by advance custom field