try:
<?php
$cat_to_EXCLUDE = 50;
$cate_id = retrieve_cat_data(true);
$cate_name = retrieve_cat_data(false);
for ($i = 0; $i < count($cate_name); $i++ ) {
?>
if ($cate_id[$i] != $cat_to_EXCLUDE){
<option value="<?php echo $cate_id[$i]; ?>"><?php echo $cate_name[$i]; ?>
</option><?php }} ?>
update:
if you search your theme’s functions.php file i bet you will find a function named retrieve_cat_data
anyway you can simple create a dropdown using wp_dropdown_categories
and you can exclude a category with its exclude
argument :
<?php wp_dropdown_categories('exclude=50'); ?>
Related Posts:
- Saving two categories from two dropdowns in front end posting form
- How to retain the values from dropdown category lists after wrong form submission?
- Additional form options based on category selected not working
- exclude category from get_posts?
- Exclude the category from the WordPress loop
- Exclude certain category from latest updates
- Exclude categories from Loop, queries, widgets, post navigation
- Dropdown with category selection
- List posts by category exclude current post
- wp_list_categories exclude not working
- Excluding a category from next and previous post links
- Get id of category from drop down menu
- Exclude Category From Home Page, Display Posts on It’s Own Page?
- How to exclude categories from recent posts, recent comments & category widgets?
- Exclude a category from the filed under list only on some templates
- How to add HTML5 ‘required’ attribute to wp_dropdown_categories() without JavaScripts?
- exclude category from WordPress Form function
- Help with multiple dropdown tags search
- How to use wp_category_checklist()?
- How to exclude posts from a category when using this particular format
- wp_dropdown_categories and custom taxonomy + custom post type
- Exclude category from Tag Template
- How to provide value for ‘selected’ on wp_dropdown_categories() for ‘multiple’ options
- exclude post from displaying in loop if it is in a category, but not in many categories
- I need to create a search form that will display search results from specific category
- Exclude Posts From Specific Category from Next and Previous post links
- Query Posts Exclude Entire Category
- exclude categories from search results
- Exclude category from fucntion
- WordPress category widget only show categories with children
- wp_dropdown_categories() scripts working erratically on sidebar
- How to use an array of categories as a dropdown?
- wp_list_pages() exclude category
- How do I display only two categories Instead of displaying all categories
- Dropdown Categories used in form shows no results when all is selected
- Trying to get variables in hacked category dropdown
- Exclude category from query
- Functions.php: Exclude Category from “Blog”
- 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
- Woocommerce filter function not updating
- Filter By Category Dropdown List With Custom Taxonomies
- wp_list_categories not excluing multiple ids
- A dropdown with checklist
- How to exclude posts from category posts count
- Exclude category from foreach loop
- Have posts that belong to multiple categories, exclude some categories from homepage
- Exclude all subcategories in the_category (post)
- I need to exclude from a query a category and a few custom taxonomies
- Exclude categories by ID
- Search form options group categories
- Redirect depending on category chosen
- Wp Dropdown Category Not Show Current As Title
- wp_dropdown_categories initial value
- Homepage custom recent news
- Exclude the category in WordPress
- How can I exclude a category from the main loop with the category name & not ID?
- User level categories
- exclude certain categories form archive widget
- Trying to get categories and sub-category listing
- How to remove an item from a custom Walker_Nav_Menu
- Exclude a category and post_type from wp_query
- Get_term_meta() always returns false
- Woocommerce Category Sort Dropdown
- How can I exclude a particular category from my WordPress Page 1 and Page 2?
- How to add custom option to wp_dropdown_categories?
- Default URL for category dropdown select option
- Exclude category from WP_Query args not working
- Displaying Category in sidebar post widget but not in the loop on home
- custom browse by
- wp_category_checklist won’t show up for non-admin users
- Get category fixed in dropdown browse categories
- Categories dropdown with all values selected using wp_dropdown_categories
- add custom option to get_categories dropdown
- Category menu that filters out empty categories
- Taxonomy for custom post type not found
- Ajax call activate after submit in edit-tags.php page
- Problems with explode [closed]
- Exclude Category From Home Page, Display Posts on It’s Own Page?
- How to have a category not show up in query post with page panigation?
- Form Value of drop down category + Translation of ‘show option none’
- Customize category query in widget
- Categories as selectable links on submission form
- Call function on a single page
- Excluding cateory not working on my site. how to solve this? [closed]
- How to define category ID in an array?
- Categories list loop – add separator every year
- SQL to migrate post types to taxonomy
- Automatically redirect a page to a category that share the same slug
- Edit tag_id in category pages of dashboard
- More efficient way to list posts by category [duplicate]
- Query posts by views on category page
- Change appearance based on category but post is in two main categories
- Modifying category order
- how to get only grandchild category from a child category
- Display the category name of a post that is in two different categories
- (WordPress) How to get custom taxonomy parent name?
- Search functionality with multiple categories
- Make a menu visible for a single category and it’s content