Try in_category
again, but also with specifying the post id:
if (in_category('destaque', $post->ID)) {
//do whatever you need to
}
Related Posts:
- Display all posts from specific categories on a page
- How to show list of posts by author and category?
- Divide Loop Into Days & Categories
- How to filter posts that belong to a specific category only if that is the only category
- Display post category in foreach loop with category link
- Child_of not displaying all children posts.. via get_posts
- Exclude category from
- Pulling in post category and children within category
- Listing Specific Categories from Current Post with Depth
- How to make the first post in the loop be styled like a “new / featured” post?
- How do I stop the loop from repeating in my category template?
- get_the_category listing in hierarchial order
- why does wordpress ignore the post args?
- Showing categories and subcategories with posts
- WP_Query of Category Not Showing First Post
- Get post category as a separate string and url
- posts going to 2 pages/categories only show up in 1
- Get current taxonomy and display query accordingly
- Only the most recent post is showing on my category page (working on localhost, not live site)
- Current post categories and subcatecories outside of the loop
- How to distinguish pages created by woocommerce?
- How to show category image if no featured image is set?
- Display new posts categories in separated divs
- List Authors For Current Category
- Multiple Post Repeat for Related Post Loop by Category
- Displaying categories items among posts
- Make assigning post to a specific category equivalent to assigning it to all categories
- Show all posts in category
- View post with specific category id and name which I selected in the backend (drop-down option)
- Including categories in search results
- How set featured posts using checkbox in post edit screen?
- Inject post (from specific category) between posts in Loop
- WP_Query: Why is sticky post not first item in loop?
- Query posts from current year
- How to use alternate post layout at key points in post loop?
- Showing random content / pictures from earlier posts in a sticky post?
- Limit function to specific post category
- Show all post titles
- Double count view in archive.php
- Posts are not showing up on particular category
- Different style for most recent article
- Differentiate between posts and pages in search results
- How to display related posts by subcategory and not parent category
- Category Template: Need to display different content on first page of archives
- Extracting post categories
- Displaying Latest Posts on a Page
- Display all posts that were published before full post on single.php
- How to limit posts by category
- How to list recent posts in a wp nav menu?
- Dynamic dependent Dropdown lists for categories, sub-categories and posts
- “Right Way” to make custom Loop respect reading settings inside admin panel?
- Only display sticky post or latest post in custom loop
- Loop doesn’t show title of second post and posts thereafter
- Grid post page on WordPress with Bootstrap, the_excerpt(); Problem
- Loop parent terms {display posts} AND loop child terms {display posts}
- How to add add more properties to WP_Post object in search results loop
- How to show all posts by author on buddypress profile with navigation
- How to add automatically bootstrap 4 order-lg-1 and order-lg-2 classes for columns in foreach loop based on the count?
- How to enable custom Shortcodes in Post Category Description? [duplicate]
- Sort by last word in title
- How to call posts under a specific category on static front page?
- Give posts a particular template based on the assigned category
- Optimize CPT-function with a loop
- Post-Archive like a page in a specific subdirectory
- How to display only one category in a custom post type?
- Get only X number of categories
- inserting a category into post
- Limiting the amount of posts retrieved by the loop
- Getting posts from some categories plus some individual posts
- Change layout of post depending on category
- latest post showing up twice on posts page
- wp_list_categories() Exclude All Categories Except One
- Different post views for different category views
- Possible?! A contextually titled back link
- Error while excluding a post from another loop (using its ID)
- How to select a category automatically based on a word in WordPress post title?
- How to add class to specific navbar item when post parent category is in specific category
- How do you change the permalink for posts for a single category?
- Posts are not displaying on their category and tag page
- Exclude posts in a category on one page but show those posts on a different page
- show loop id post , only first id can read
- Excluding category from post navigation in WordPress?
- Show custom post category for single post
- Get a list of categories that are related to posts
- Querying posts from current category, using a variable as array argument
- Wp_query loop is not working as it should
- Problem with wp_insert_post()
- How to control Post view count incresing in sidebar widget posts too?
- Precedence of page permalinks over woocommerce product category links?
- Need help writing loop to display posts by categories in separate divs
- Add category selection to function request
- Query post category & remove any post id
- Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working
- Retrieve latest post by multiple categories with ID
- Is there a way to separate wordpress titles from their posts?
- Redirecting posts in WordPress to a specific page
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- Show some texts in posts belonging to Specific category
- Filters do not work when there are multiple (one works)
- WordPress Ajax load doesn’t work