Using in_category
here is the correct function to use (it doesn’t distinguish between post types).
The second argument accepted by in_category
is the post ID or object – but in this case, can be omitted as we are using it inside the Loop.
The first argument is the Category ID (as an integer) or slug / name (as a string). Or alternatively an array of these. So make sure that ‘Lesson Pack’ is the name of the category (or else try using the slug, or the category ID).
Edit
As per comments, the plugin uses a custom taxonomy rather than the default category taxonomy. In that case, the function you should use is: has_term
has_term('Lesson Pack', 'my-custom-taxonomy')
where the second argument is the name of the custom taxonomy.
Related Posts:
- Filtering a custom post type by custom taxonomy in archive template
- Exclude a category from WP_Query
- How to build a complex page structure
- How to filter custom post types by custom category taxonomy
- Is there a way to use regular categories with custom post types?
- How to list all categories and tags in a page?
- remove support for ‘Categories’ for a custom post type
- Glossary with Custom Post Type
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Filter get_categories() for taxonomy term in WordPress
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Taxonomy list. Order by a specific custom post type count
- How to show custom taxonomy in the permalink?
- Custom/separate categories for custom post type
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Taxonomy structure of Sport site
- Display Custom Category (taxonomy) Name in Custom Post Type
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Show Post Count of a Category
- custom taxonomy archive by year
- Get categories and descriptions from custom post type
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Combining custom post type and post category
- Querying Term Posts in Loop
- How to create new category for custom post type?
- Insert HTML inside link in a walker
- Custom Post Types and independent Categories – complex Taxonomy
- Should I use custom taxonomy or custom post type
- Set menu active state for custom posttype and category, given custom taxonomy term
- Display all posts in main category and 1 subcategory
- Custom Post Type Archive Page Filtering
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- Posts from all the categories are being displayed instead of particular category
- Conditional Statement custom post type category
- Custom Post Type With Categories
- Categories sorting
- Allow user to set custom order to a list of custom taxonomies?
- get_category_parents for custom post type taxonomy
- wp_list_categories() – current-cat class also inside posts?
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- Show a Category X’s custom post type on Category X archive page?
- Cannot add category or custom taxonomy from admin. WordPress site is hosted in Windows 16 server via IIS. No XAMPP or WAMP
- Hide parent categories when clicked, and show it’s childs
- Limit amount of posts made within a custom taxonomy
- Can’t remove front from permalinks for custom taxonomy category page
- How to get custom posts sub category link
- browse by category and tags?
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- List of Posts and Categories
- WP the_posts() on single-cars.php get category link
- Get parent category id from child category page for custom taxonomy
- How to add current custom taxonomy slug to body class
- get_category_link() for custom post type does not include custom slug rewrite?
- Disable custom taxonomy on admin bar
- Why does my taxonomy have a category style div id?
- Targeting categories in custom fields
- Listing all slugs?
- category list with cutom post count
- Include custom post type custom taxonomies in Categories widget
- Custom Post Type Categories URL not displaying posts
- Custom post type categories gives 404 error
- get_terms() parent, child and grandchild
- Custom Post Type Custom Archive Page Not Working
- List child categories from parent category on custom taxonomy page
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Custom post types category
- Can’t pull posts of a Custom Post Type based on the custom taxonomy of the CPT
- Custom post not appearing under custom taxonomy category
- Retrieve Custom Taxonomies with Description and Slug
- Custom post type category permalinks and archive pages
- Custom post type specific category box
- Custom Taxonomy Taxonomies of Same Name point to first created URL
- how to organize my categories or should I do custom post types for some?
- Advanced archive url structure (category, tag and date)
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- Can’t Get Parent and Child Categories of Custom Taxonomy to Display
- How to show related posts of category on post within custom posttype
- How to display custom taxonomy term specific post?
- How to set “section categories”?
- Create custom post type categories
- Set a Default CPT taxonomy by taxonomy id
- How to manage a dynamic multi-level page hierearchy system?
- Categories manage
- Help with Travel Guide Setup
- Custom post types not displaying per category
- Help with Multi Level Category Archive Page
- Dropdown switching subcategories portfolio
- Display custom Taxonomies same as listing Categories
- Post Editor: display categories from current post type taxonomy only?
- Get a list of categories ids
- Trying to create hierarchy between 3-4 custom post types
- Customize category URL
- Category / Custom Post Type permalink issue
- Display a custom post type list by taxonomy term
- Return Custom Post Type Categories
- Highlight specific menu item when custom post is page
- How can I show second most recent post in sidebar, if most recent post is open in the browser?
- Is it possible for post and custom post type to share a category base slug?
- How to add categories to a custom post type using wp_insert_post($new_post);