Since you are doing this for a custom taxonomy (solution_cats), then you should instead use has_term() and not in_category() which works only with the default/core category taxonomy. So try this with your second code:
has_term( $category->slug, $category->taxonomy, get_the_ID() )
is_object_in_term() can also be used, but your syntax was not correct – the 2nd parameter is actually the term’s taxonomy and not the term ID/name/slug (which should instead be the 3rd parameter).
- The correct syntax:
is_object_in_term(get_the_ID(),$value->taxonomy,$value->term_id) - But you used this:
is_object_in_term(get_the_ID(),$value->term_id)
Related Posts:
- Redirect to another page using contact form 7? [closed]
- Adding custom post category to categories widget
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- Plugin for changing a post’s category based on it’s post date?
- Enable comments for post with comments meta box removed
- Custom Post Type causes Page Not Found
- plugin for wp_list_categories with posts
- Is there a way to order posts and custom post types as one group?
- How can i list random post from multiple category?
- Accessing post’s meta data based on user’s click of a post
- Solutions to repost categories into multisite blogs?
- Calendar Solution: Handling upcoming Dates with Posts?
- get_post_type on post.php
- Any built-in function to associate a post to category through a plugin?
- Matching Chapters to a Custom posts [closed]
- Display by Category in Admin
- How to delete all trashed item in one-go
- Custom setup of wordpress comments that are displayed
- Recent posts per category loop?
- How to set category correctly for a custom post created by a remote API call?
- posts from multiple post types in one slider
- check uncategorized category by default
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- Custom Template for wordpress cpt plugin
- What hook can I use to modify custom post data before it is displayed on the page?
- How to get Recent Post From Each Category with Thumbnail?
- Is it possible to pin a post in second position from top
- Custom Post Type same name as Category
- How to display the category name in the tab and post inside the tab in WordPress?
- Is there a hook similar to “save_post” which only fires AFTER the post is completely published?
- Custom Post Type with Sequence ID
- How to display the custom post related blog by category?
- WordPress hide post from custom post-type on a single page
- automatically set random featured image by category in wordpress on post
- Is it possible to customize a wordpress post from outside dashboard(Something like site.com/post-type/post/?e=post_id)?
- WordPress list child pages of custom post type
- Find And Add Category to Posts
- Retrieve post thumbnails
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- How to add character to content of post?
- Insert data in custom table during new post creation
- single.php fires more than once after clicking on any post to view with different post id each time
- Twitter List Tweets and Delicious Links as Posts
- Automatically set posts to NoIndex depending on category?
- hide particular category post from front page only [closed]
- Can i have limit posts on a specific category and automatically remove older ones?
- How to export post tags from wordpress
- How to add portfolio category post count in main navigation menu?
- How to Display Product specific to a category with WooCommerce Plugin? [closed]
- How to show all posts of the category in wordpress?
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- Custom database or Custom Post Types?
- Prevent page slug from interfering with custom post type archive permalink?
- Themes VS Plugins [duplicate]
- Plugin “Meta Box”: Implementing meta boxes in custom post type
- Plugin allowing for artists, events and venues
- Disable Other Plugins on my Custom Post Type?
- Execute a plugin only on post pages
- RW Meta Box ,Problem setting post title
- How do I “get the next 10 posts after post_id == x”?
- Post injections into Site Origins Page builder [closed]
- How to get all posts belongs to a user between a certain date
- How to Display Posts From Category Within a Custom Taxonomy?
- Article content navigator in wordpress like mbaskool website
- Getting a list of the published posts
- Categories from front-end, checkbox selection doesn’t work
- Custom Post Type template for homepage
- WordPress Stats Plugin: Display Post Views [closed]
- How to search post titles with whole words only, but not the exact word only?
- Display all Categories except ones with a specific parent
- How to hide featured images of all posts falling under the same category in wordpress?
- Remove custom taxonomy name from the slug – Custom Post Type UI
- Help to Create a Simple Plugin to make a post
- New posts are not showing up on my front page
- Moving all wordpress posts from 50 websites to another website
- custom post type get_posts() function not work
- Create multiple posts when a custom post is created
- Cannot view Custom Post Type no matter what I try
- Powerpress upload a podcast without creating a post for it
- add tags to wordpress post using REST API
- How to upload PDF from Front-End and post automatically?
- Get value from an input field and pass into update_meta_data as $meta_value
- Get content and send to 3rd party
- Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?
- Different email notifications (about pending posts) to different users
- How to display single arbitrary facebook post with a shortcode?
- Custom post type request switches to media request
- How to Batch Upload .docx Files as Posts
- Custom Post type plugin breaking the front page shows dashboard?
- How can i do custom author list?
- Display static pages instead of category, in code
- Static page with formatted post list
- formatting the way posts show up
- Automatically put a menu on every post
- Preset categories in wordpress by GET-paremters [duplicate]
- Filter custom post type returned from REST api
- Create WordPress category dynamically
- Redirect a specific User role not admins automatically to view the post that they just updated
- warning wp session
- What is the easiest way to create a custom field archive?