The array for post_category needs to be an array of integers, not a string, and that’s what you are getting from the $_POST[‘cat’] the way you have it written. Change the value in the option to the category id instead.
Related Posts:
- Grab posts by multiple categories
- How to show only subcategories in parent category not parent category?
- Use get() method to grab all categories and output inside another method
- Listing titles and custom fields of entries within subcategories
- WordPress custom taxonomy
- Get category id for a custom category and display it in a class
- Get category name of current post (CPT UI)
- get post based on category chosen in drop down – The ajax method
- How to use transient in this code for related post?
- get_term_link() returns incorrect url
- Creating a related post section based on similar categories
- Swapping wp_dropdown_categories function with wp_category_checklist
- Create a hierarchical taxonomy list in WordPress
- Randomly Assign an Image’s Alt Text Based on Data From Post
- Proper syntax or method for keeping url in modified isotope / category links
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Filter Select results based on selection
- What is an equivalent of single_cat_title for getting the slug of the category?
- Issue adding sub category programmatically
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- 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
- 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
- How to pick the default selected value in wordpress dropdown?
- Applying A Category to Existing Posts Where Page Title Matches Regex
- Get page that displays all children of taxonomy parent
- How to get original custom taxonomy slug after the slug has been rewritten?
- Displaying custom taxonomy on WooCommerce product page
- selected option if current category is the value
- get_template_part based upon post’s category
- How to split links generated into an xml sitemap to avoid exceeding 30 sec maximum execution time?
- how to save selected option in variable for rest api category filter
- Setting default category base on theme activation
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- Hide subcategories (widget)
- 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
- How to get post’s current parent term ID?
- Display category name only once inside loop
- multiple taxonomy select display only one in front end
- Display parent and child taxonomies in separate drop down select fields
- need help with existing code showing subpages
- Custom field values to taxonomy terms
- how to show only specific category for a template
- Pull Tags But Not as Links
- Dilemma of Populating all the categories in a drop down list
- Display most popular posts of category
- 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
- Copy taxonomy terms from one post to another programmatically
- How to array only one key from another array
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- Get all categories post is not in
- Get latest post from all categories except one
- Displaying posts based on category
- How do I remove a category from a wordpress loop>
- Get categories names as an array to use it in theme settings
- working with term_relationships table
- How to filter custom taxonomy term name, slug, and description?
- 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?
- Ajax filter button display all posts
- Hierarchical taxonomy list with modificated term links
- In WordPress, how do I get the number of posts next to single_cat_title(”); in the category.php file?
- Only show size attributes in product box woocommerce when available
- How to get category name or ID by post?
- Custom post type category not displaying category ID
- Argument for if term-> have child?
- How to get current post category details inside “loop”?
- Show the section only if custom taxonomy was chosen
- How to separate categories with commas?
- Exclude product attributes from taxonomy terms loop
- How to hide posts of a specific custom category in WordPress?
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Show all tags within a category?
- Post not populating for custom post type based on category selection
- Add new post in existing categories using wp_insert_post
- How to change logo by category
- Problem with custom loop and wp_list_pluck [closed]
- fetch woocommerce product with custom taxonomy
- random display categories – change url
- Displaying list of posts in category page
- Echoing a CSS class based on category of post in a list
- Alphabetically Ordered Category in WordPress
- Output category list inside array
- Do not duplicate posts with multiple categories in multiple loops
- Loading Posts & Category with Ajax
- Removing sidebar on category pages
- How to get current category
- WooCommerce: Display product categories to make IF statement