It looks like you’re mixing the WordPress in_category() function with plugin / theme code that isn’t setting up a standard WP Query or post object. So you can’t use in_category().
Use var_dump($content);
and var_dump($data);
to see if either of those objects have a ‘category’ property for the content. Use that in an if statement instead, e.g.: if($data->category-id == 26)
Related Posts:
- Exclude category on blog list page
- How can I remove posts of a certain category from homepage after a specified time period?
- How to filter posts that belong to a specific category only if that is the only category
- Widget that shows categories with posts numbers
- wp_list_categories() Exclude All Categories Except One
- Get current taxonomy and display query accordingly
- how to filter posts by category without page load (ajax) in wordpress?
- How to add a block to a category page?
- show only one category and filter by tag
- Filters do not work when there are multiple (one works)
- How to display blog posts per category using tabs or accordion?
- How to allow users to post only in certain category and hide elements from edit page?
- How to filter my search in post if contains a word in title, content or excerpt?
- More then one menu items are assigned with “current-menu-item” class
- Update post_content everytime a custom post is opened in backend
- How can i limit the number of posts created per category?
- How to Restrict Previous & Next Post Link to Posts of Same Category?
- Pulling in post category and children within category
- WordPress custom Query for Posts in Category display posts multiple times
- Post categories to pages
- Get user categories with most posts in it
- Post page to display specific category
- Get Posts Under Custom Taxonomy
- Posts and Attachments with “Published” status in Search
- Get attachments for posts that belongs to a specific category
- Prevent additional top level categories but allow more children
- Need help with category listing!
- Prepending %category% onto default posts fails
- List all categories with featured image from post?
- Categories list into registration form
- WP_Query: Mixing category__in and tag__in together
- If in_category not working for multiple single.php pages
- How can I setup a relationship using categories in WordPress?
- WordPress Multisite – Create Default Post and New Category On New Site Install
- how to show single post in a custom template
- Using ajax on editing a category edit page?
- Related posts by category not working right
- How to list recent posts in a wp nav menu?
- Set Default Category to Username
- Disable sticky option for specific categories
- remove post and categories/tags count from right now dashboard widget
- Dynamic dependent Dropdown lists for categories, sub-categories and posts
- How to allow visitors to filter posts by multiple taxonomies
- How can I hide tags on a child-category page, if that tag has not been used?
- date issue with category post retrival
- Listing Specific Categories from Current Post with Depth
- How to make multiple sections in home pulling posts category wise?
- How to display two blog categories as separate sections on one page?
- How to make the first post in the loop be styled like a “new / featured” post?
- How to Mysql select a list of posts with meta_values AND all relevant categories?
- Redirect to another page using contact form 7? [closed]
- Display post category in foreach loop
- Single.php – Get Current Parent Category
- How do I stop the loop from repeating in my category template?
- Trying to alter the post_content through the_post
- get_the_category listing in hierarchial order
- Is it possible to add/tick a category to a post when it is created?
- Excluding posts not working
- Hide posts belongs to few categories in homepage
- Create new custom post and post category of same name
- why does wordpress ignore the post args?
- post category in wp_insert_post
- add to end of post in the loop with plugin
- Limit the number of posts a category can have – newest post goes in, oldest one drops out, possible? plugin?
- Add filter to the end of the post
- How to get subcategories from category slug?
- Remove current category from post but display all others
- How show categories in admin and get that selected to show posts in index
- Get post content with all filters applied, knowing post id
- Showing categories and subcategories with posts
- Change default category when I publish a post
- store posts_id of category into a varable?
- Adding bootstrap classes to video shortcodes
- Is it possible to filter the main loop to exclude posts from a specific category?
- How to display two random-post sections that are each under their own category
- How can you display all sibling categories to a post?
- Loop doesn’t exclude the specified category in home page
- query post limits
- Display posts of specific category term
- How to create a sub post?
- Post Image not displaying in category view
- How do I show posts from another wordpress installation?
- get posts from Custom Post Type & Category
- Category page when using static front page
- Getting Duplicate Posts on Home Page with Widget Added Between Posts
- Latest posts by category — how to exclude current post?
- How do I include the category next to the title of a post?
- Relative number of post in category
- Modify posts listing at back end
- How to create a “latest news” page showing a list of posts from blog category
- Filtering posts on Post Administration Page by Week Number instead of by Month
- WordPress bulk category select when publishing post
- Prevent posts with certain post_meta to be edited
- Exclude some categories from listing on the current post
- How to show a custom taxonomy in the theme?
- How to import nested categories from XML file?
- how to hide empty fields of post category description?
- Change the default blog post post attribute template name from “default template” to something else
- how can i display my posts alphabetically?
- Hook for changing excerpt content when excerpt not set