@Milo was absolutely correct…the issue was that I wasn’t getting a string to compare. The solution actually came from here.
What this ultimately looked like in my scenario:
<?php
if(has_term('dining-1', 'page_category', $post->ID)){
get_template_part('sidebar', 'dining-one');
}
elseif(has_term('dining-2', 'page_category', $post->ID)){
//etc.
}
?>
Related Posts:
- Passing taxonomy id of taxonomy clicked on one page to another page
- How to prevent new terms being added to a custom taxonomy?
- WP REST API no longer supports filter param, so how do I get posts in a custom taxonomy?
- Include and Exclude Taxonomies From Archives & Feeds Using ‘pre_get_posts’
- Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)
- Get value in custom field with taxonomy [closed]
- Get second level terms of custom taxonomy
- Taxonomy menu with post count and multiple parents
- Modify Term Update Redirection
- How to get first post in a category of a custom taxonomy
- How to get the singular name of a custom taxonomy?
- Archive template for taxonomy terms
- pre_get_posts OR relation between taxonomy and author
- Custom Fields and performance
- Non-hierarchical custom taxonomy using checkboxes on edit-screen -> saving issue
- Dynamic page slug for Custom Taxonomies?
- show term description instead of list terms of custom taxonomy
- get_the_term_list without specific category
- Add Category Name to REST API
- Display the Terms from a Custom Taxonomy Assigned to a Post(inside the loop) in Hierarchial Order
- Edit post meta with checkboxes on front end
- drop-down list taxonomy problem
- Redirect to Post List by Taxonomy on User Selection of Taxonomy Dropdown?
- How do I get WordPress URL rewrites into Sitemap?
- How to display custom taxonomy in multiple columns?
- Custom taxonomy sort by term meta in admin columns
- Programatically added attribute, set to ‘show on product page’ automatically. Woocommerce [closed]
- WordPress Custom Taxonomy – Volume / Issue – Unique Slug Issue
- How to show the entries in a custom taxonomy by author?
- Get Current Custom Taxonomy ID by Post ID
- Custom fields to taxonomy
- Correct way to insert taxonomies on page insert
- Get_terms stopped working after WP 4.2
- Styling Taxonomy Terms Individually
- Get terms cross-taxonomy query
- Custom Taxonomy Template Error: Catchable fatal error: Object of class WP_Error could not be converted to string
- triple drop down for populating custom taxonomies
- Custom Taxonomy in default RSS feed
- How to make custom post taxonomy looks like regular categories?
- Create Geographical regions -> countries structure and relationship with taxonomies
- Unexpected results from get_taxonomies() and {$taxonomy}_edit_form and related hook
- Custom Taxonomy Term Archive Page Template that Filters 2 or more Taxonomies
- Custom taxonomy link opens under Posts
- Changing URLs for taxonomies and CPT
- Front-End Custom Taxonomy Tag Select
- Override Taxonomy Template
- Set tax_query conditionally with new WP_Query
- how to store values in database at hierarchical view
- Strip tags from a the terms() function
- Why can’t I use an array of term slugs in WP_Query?
- Using wp_dropdown_categories in widget options
- Trying to add taxonomy to get_categories() but it’s not working. How to fix this?
- Custom taxonomy archive page requires ?post_type= in url
- Custom taxonomy terms not showing as list Gutenberg Editor WordPress
- Twin value tags as an esoteric taxonomy
- Adding a custom taxonomy to “nav_menu_item”
- Clean Custom URL for Serach + Custom Taxonomy
- Advanced search redirecting to another page then filter further
- pagination not working on custom-taxonomy template
- Limit Display Number Of Taxonomy Term
- Custom arguments in WP_Query
- Sort and paginate custom post taxonomies alphabetically
- Current taxonomy name (not term!) given a post ID
- Search box with field hidden till drop down selection is made
- Can You Build Page Templates Without Extra Files
- 404 Error on Custom Post Type / Custom Taxonomy
- Unsetting post_tag taxonomy breaks term description for other taxonomies
- Taxonomies on Pages with Custom Formatting
- Terms added to custom taxonomy for custom post type only appear in Rest when added in code
- Is there a way to nest taxonomies or custom fields deeper than one level below the post type?
- Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
- Showing custom taxonomy in woocommerce signle product page
- Get custom taxonomy terms that contain posts that have another taxonomy term
- Custom taxonomy not showing in grid view for ‘attachment’ post type
- How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?
- How to create archive pages for metadata query generated posts (so without taxonomy)?
- How to create a completely functioning separate archive for posts from only 1 or 2 specific categories
- How to get list of custom taxonomies based on custom post type
- how to filter the data’s comparison operators (>= &
- Pods pagination erases my sub menu
- Sort Taxonomy List by Custom Values
- How to filter a taxonomy meta field to the ‘single_term_title’ filter hook
- Using wp_tag_cloud with only current post tag with special class
- Does a codex exist for creating meta boxes in taxonomy
- Display taxonomy term slugs
- Run next query based on first query’s term
- Get the original menu item name string instead of the label
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Tax query array terms display out of order
- How to query posts that are not related to any term of a taxonomy?
- Function code problem
- Permalinks not working on MU network with domain mapping
- add_action with variable as a part of the $tag string
- Get custom taxonomy term url on archive page
- I’ve got a function that auto creates taxonomy terms – Can it auto delete them as well?
- Get custom taxonomy value of post and output posts in same taxonomy
- How to display Custom taxonomy on custom post listing page [duplicate]
- Taxonomy to display form after creation
- How home my code doesn’t display any feature image? Looping through post from a taxonomy and not getting feature images back
- Add taxonomy fields of posts into RSS feed