Got help on Facebook and just needed to change this:
<option value="<?php echo $term->name; ?>" <?php if($_POST['mealtype'] == $term->name) { echo 'selected'; } ?>><?php echo $term->name; ?></option>
to this:
<option value="<?php echo $term->slug; ?>" <?php if($_POST['mealtype'] == $term->slug) { echo 'selected'; } ?>><?php echo $term->name; ?></option>
Related Posts:
- How to get_queried_object on multiple objects?
- Display all posts in a custom post type, grouped by a custom taxonomy
- How to use a custom post type archive as front page?
- How to set a custom post type to have viewable future posts
- Exclude a category from WP_Query
- $wp_query->queried_object->ID throws warning: Undefined property
- Select All in Parent Category, Group by Child Category?
- get_query_var() not working in pre_get_posts
- query multiple taxonomies
- Custom Taxonomy with Custom Post Type Finds No Posts
- The Operator “NOT IN” Does Not Work In tax_query
- Counting Posts of a Given Post Type Having a Specific Taxonomy?
- Custom query – alternate posts by category
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Is it possible to have an index page for taxonomy term for each custom post type it is assigned to?
- Custom Post Type / Taxonomy Slug / Post Title with post type archive
- how to group custom post type posts by custom taxonomy terms
- Hide child term posts on parent term pages
- Posts per Page on custom Taxonomy Template
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- Post type archive page not working
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- How to get the parent’s taxonomy?
- Querying Posts by Taxonomy From Alternate Network Site
- Sort the main query in subcategories/terms?
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- Archive page for taxonomy of custom post type
- Help with hierarchical custom taxonomies and permalinks…almost there
- Custom Taxonomy List links being re-written
- Should I change these content meta types before building complex archive page?
- custom post type paging not working past page 3
- Getting taxonomy terms used by custom post type
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Want to filter only parent post in admin area
- Archive or taxonomy pages not working for custom post type
- Multiple Archive Pages for Custom Post Types AND Taxonomies
- Custom Taxonomy and tax_query Issue?
- Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar
- How to create archive page for taxonomy terms within custom post type
- Query for posts in 2 taxonomies
- Exclude current post when getting related post on custom post type and taxonomy
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Ordering Custom Post Types with WP_Query
- Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy
- Paginated Taxonomy Term Archive including one post per term
- Custom post query by taxonomy
- Querying CPT with Two Taxonomies
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Custom Query to display posts with custom field
- Get taxonomy description based on variable
- Optimised Code for Pulling Taxonomy Posts
- Show Post Count of a Category
- WP_Query search posts by custom post type and custom taxonomy
- taxonomy template for custom post type the same as the archive
- Display only post types that are direct children of the current taxonomy
- Is it possible to create a shortcode that will query a post based on taxonomies?
- wp_query to find posts by year and month
- Querying Term Posts in Loop
- How can I filter by taxonomy on a custom post type’s page?
- How to use WP_Query in a CPT achive page?
- Custom Post Type Loop within Shortcode
- Fetch taxonomies by custom post type id array
- is_main_query() not working for WP REST API
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- WP_Query | ‘post_type’ doesn’t work
- Filter by custom taxonomy slug on a custom post type
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Display CPT posts based on specific taxonomy
- Custom template won’t load for a custom post type (custom permalinks used)
- shortcode to show custom post types by category
- Query/list all terms and their custom post count
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Genesis filterable portfolio isotope [closed]
- wp_query check if integer exists in custom field’s array
- Custom post type templating problem
- Wrong request query on cpt and tax
- Catergory args causing loop not to show
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- display custom post type from register taxonomy
- Attaching multiple custom taxonomies to one CPT?
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)
- WP Query Conditionally query meta and taxonomy
- Sort ACF by custom taxonomy
- Complex Custom Loop with Includes
- Query custom post type and group by taxonomy
- WP Query – Can’t get posts with specific taxonomy
- Dynamically count the number of custom post types associated to a custom taxonomy
- How to work with URLs where sometimes a post or a subcategory is in the same part of the URL structure
- WP_Query not using relation key as expected and not producing any results
- WP Query filtering by custom category not showing all relevant posts
- How to assign a single-menu-template to a menu-items in a taxony/ cat/ subcat/ subcat-item
- Custom fields disappearing when a custom post type is assigned
- Rewrite taxonomy permalink appended to CPT archive url
- wp_insert_term how to insert “” in description