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?
- Disable All In One SEO plugin for custom post type
- Way to hook into a sidebar call to replace it with a custom sidebar
- Set attached to state
- Use plugin or custom post type for game score functionality
- Frontend editing, Frontend user dashboard
- Plugin allowing for artists, events and venues
- Set a category for a page
- Disable Other Plugins on my Custom Post Type?
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Tag link suggestion plugin
- How to add new tabs in post.php
- How to get images from EDD post?
- How to change ID of an attachment in wp_posts and its related tables correctly?
- Collaborative post submission [closed]
- CKEditor: Uncaught TypeError: switchEditors.switchto is not a functiononclick
- custom taxonomy and custom post type url conflict
- New post notification plugin [closed]
- Is there plugin to show recent posts from one website in the widget area of another?
- Bulk Image Uploader to create new post from each image [closed]
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- How use %like% in sql statement wordpress
- Display comments of users on single page
- wordpress reusable content blocks
- Override plugin with functions.php
- Get the url of the full sized attachment image using post ID?
- Adding Plugin-specific Fields with wp_insert_post()?
- Adding Attachment Display Settings in custom media frame
- Should i delete the posts created by a plugin on uninstall?
- Show Heirachy of categories in WP Download Monitor
- Output HTML only on individual post view
- Allow users mark posts as “complete”?
- Using the “Latest posts” feature on a different site
- Post query – show posts from specified day and month and whole years
- Custom Post Type Plugin not loading category template and loading 404 instead
- How to get the post type from a category id?
- Display content from custom post type if match to main post category
- Execute a plugin only on post pages
- RW Meta Box ,Problem setting post title
- How does WP handle multiple matching rewrite rules?
- Support for simultaneous editing
- how do i remove posts from a WP_Query so the pagination is right?
- Saving Custom Post types and fields to a custom table
- dynamically generating plugin syntax
- How to get 1 or 2 specific posts on top of my wordpress blog?
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- Portfolio + Blog: multisite or plugin?
- Building a store locator with google maps
- My Category is too big on the Menu what can i do?
- Getting a List of Categories for Use in a Plugin?
- Duplicate posts when posting nulls in records in phpMyAdmin [closed]
- Not able to open category post [closed]
- How to make wp_enqueue_style and wp_enqueue_script work only on custom post type