For the type of your $catId, you must use the cat
parameter.
You can check here the differents parameters allowed.
cat (int) – use category id.
category_name (string) – use category slug.
category__and (array) – use category id.
category__in (array) – use category id.
category__not_in (array) – use category id.
Related Posts:
- How to show all posts of the category in wordpress?
- Get category id from post id of a custom post type
- Limit widget to a specific registered sidebar
- Include custom post types in categories widget
- How to show related posts by category or custom post type?
- Structuring a product catalogue in WordPress [closed]
- How to embed form data within the ‘Add new post’
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- How to get the post type from a category id?
- Getting posts under the custom post type ui category
- Show custom post type filtered by category
- Showing posts from different categories and from custom post type
- Add custom post type settings to wordress default posts
- Problem with displaying posts in the CPT category
- Set a checkmark in a category based on a URL-parameter
- Get the category from custom post type
- Custom Post Slug same as Parents Category Slug
- How can I show 1 featured post in a styled element, and the next few below differently styled
- WP the_posts() on single-cars.php get category link
- Create new custom post and post category of same name
- Custom post types and ‘new WP_Query’
- How to Display Posts From Category Within a Custom Taxonomy?
- Showing custom post type categories in the menu
- Stores category posts in an array
- Restrict category access to specific users/groups. Author always has access
- Use post in multiple places on a page with multiple posts
- Am I mixing up the concept of posts pages and categories?
- Display all Categories except ones with a specific parent
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Adding custom post category to categories widget
- Post category behave like a Post in back office menu
- Save data is post using php front end
- How to show posts of the same category on a page?
- How to manage a dynamic multi-level page hierearchy system?
- Custom Post By Category
- Widget area for individual posts (custom post type)?
- Change Custom Post Type to Post + Category
- Only show current category post
- Post Editor: display categories from current post type taxonomy only?
- Custom Post Type used for FAQs Accordion
- Display all post types together
- show only one category posts in admin
- Can WordPress show posts based on a button that the user clicked 2 pages back?
- Remove slug from custom post type post URLs
- Custom Post Type Data in Sidebar widgets?
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Showing current taxonomy terms
- Newer/Older posts links display same posts on every page
- custom sortable column
- When viewing single parent post, display list of children
- Limit Authors to their Own Posts on front-end excluding admins
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Custom post types and permalink
- ‘Pages’ widget alternative for custom post types?
- Including Custom Post Type posts in a page template contextually (or should I widget?)
- Search doesn’t find tags or categories in custom post types
- Loop on front-page.php
- How to add custom post types to normal category pages
- How to create custom boxes with text inside?
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- Linking to the most recent post in a Custom Post Type
- Categories sorting
- How can I make my custom posts appear in their assigned category url?
- Allow user to set custom order to a list of custom taxonomies?
- Disable block with taxonomies at post page
- Changing custom type name hides the posts
- Display Custom Toxonomy In WordPress and theme Widgets category selection dropdown list
- Two Custom Post Types Many to Many Relationship
- Custom Post Types with a common category for a blog listing
- No Permission to add new Page, Post or CPT with Admin role
- Update postmeta Parent when post_status child change
- Custom Widget WP_Query problem
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- 2 Different Custom Post Types in Submenu
- How to assign classes to all elements?
- Reworking function for counting custom post type posts count
- Archieve.php not loading for custom post type
- Why isn’t a list of posts from my custom post type displaying in this widget?
- Assign category a default post type
- WP_Query with custom post type ID
- Need help deciding on a taxonomy
- Get Posts by Category, Tag , and CPT Taxonomy
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Custom post types category
- Advanced archive url structure (category, tag and date)
- Does “Custom Post Type” can have page hierarhy option?
- How to mass get post editor URLs
- How to show related posts of category on post within custom posttype
- Custom Post Types – trying to make “title” display
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- subtracting the current post form then whole loop, which is generating all CPT titles
- I can not call the categories of custom post type
- Best way to structure article and issue relationship for CPT
- Post content stays the same but permalink changes ?
- Custom Post Type Permalinks with %category%
- Can I set a CPT title field to a dropdown with preset options if user is of a given type?
- Is it possible to make is_category() recursive?
- How Do I Add a Custom Post Type URL to Content?
- How to add categories to a custom post type using wp_insert_post($new_post);