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 show related posts by category
- Including categories in search results
- Removing any and all inline styles from the_content()
- Count how many posts in category
- Custom Single Post By Category
- Convert custom fields to post categories
- Query posts from current year
- Filter posts by author and category simultaneously
- Show One Category on Post
- Get all posts by post_author
- Display all posts under child sub category in sidebar on post page?
- Do I use custom post type or something else?
- What Defines What Category A Post Picks (if in multiple)
- Limit function to specific post category
- Show all post titles
- Add Category name to Post Title (h1)
- Posts are not showing up on particular category
- How can I display widget in a Page or Post?
- How to display related posts by subcategory and not parent category
- Category Template: Need to display different content on first page of archives
- How to add Tags Filter in wordpress admin dashboard
- Admin Posts Table Column Fitlering is not working for Custom Post Type
- Display post category in foreach loop with category link
- Get mixed category random posts
- Extracting post categories
- How to limit posts by category
- Ajax post filters not working
- Display Meta Values in Custom Filter – Admin Custom Posts
- Get user categories with most posts in it
- Related posts by category not working right
- Listing Specific Categories from Current Post with Depth
- How to Mysql select a list of posts with meta_values AND all relevant categories?
- Redirect to another page using contact form 7? [closed]
- get_the_category listing in hierarchial order
- Change the default blog post post attribute template name from “default template” to something else
- How to enable custom Shortcodes in Post Category Description? [duplicate]
- Show posts on front page only
- Post is in descendant category not working in home.php
- How to get posts ordered by using their categories?
- Hide parts of the post content after typing it’s name or searching it by category
- SQL Bulk Move old posts by one author to another category
- load more posts by category
- Display Related Posts by Category in Random
- How to show beneath posts the full category path?
- Display Current Posts Category (with the most posts)?
- How to select a category automatically based on a word in WordPress post title?
- How to show multiple posts thumbnail, title and date in widget
- Only the most recent post is showing on my category page (working on localhost, not live site)
- Show only posts with titles/permalinks that do not contain certain words
- Create a List of Widgets, where each widget holds three attributes
- ACF date picker to trigger category change
- Get category slug of the Parent category of a Product
- Add filter for specific category only
- Filter posts by month (dropdown)
- Adding custom post category to categories widget
- How to add class to specific navbar item when post parent category is in specific category
- exclude particular category in api
- Make categories appear random
- Add view to admin menu to filter for specific criteria ( If post is child of specific Parent )
- How to make a page show posts only from specific categories without editing php files
- Get posts from category from custom query
- Show custom post category for single post
- Get a list of categories that are related to posts
- How to show posts ordered by random [duplicate]
- How to Get Position of a Post from a category and tag
- Display new posts categories in separated divs
- Add Categories To Custom Post
- Query posts from newest category
- Display Posts by Categories
- Ajax – Post Categories and Load More
- Edit Posts Page but not category specific pages?
- How to modify specific parts of a post content in WordPress
- How to organise post by category and date
- Show post if in category
- How to display custom content in post with category XXX
- Displaying categories items among posts
- Displaying different posts Via wp_list_categories()
- Is possible to create a custom link that creates a post that’s already categorized?
- Is it possible to have different header style blog titles in different categories?
- Category pages vs single post pages
- How to display subcategory articles in the category view?
- How do we display a certain category type on a page while hiding all others?
- Show some texts in posts belonging to Specific category
- wordpress category Description not allowed tag
- Image inside the content is replaced with featured image from my older post
- How to get a list of all posts and their categories?
- Show posts assigned to multiple categories in current category page
- How to display related posts from the same category?
- Add function to single blog post pages only
- Mismatch between posts count and actual list in admin posts page