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?
- Display posts of only a certain category in WP Admin section?
- Shortcode for display posts on home page show only one post
- Deleting Custom Post type data using mySQL command
- Pagination is not working on single-{slug}.php but works fine on page-{slug}.php
- Find the user who initially created the post
- Use post as category
- Need help targeting a custom post type with conditional tags
- How to add custom post types to normal category pages
- Pagination on category page with custom post types
- Insert HTML inside link in a walker
- right_now_content_table_end function not working?
- Custom Post Types and independent Categories – complex Taxonomy
- Call custom post type by category
- Add category attribute to custom shortcode
- Notice: Undefined index: suppress_filters
- How to Separate CPT From Regular Posts?
- Use regular category with custom post types
- Remove rows in the manage post/page view
- Should I use custom menu, C.P.T. or theme options, or something else for this?
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- Should I use custom taxonomy or custom post type
- How to detect filter in URL in Category page?
- Set menu active state for custom posttype and category, given custom taxonomy term
- How to show CPTs in term archive
- How to create custom boxes with text inside?
- How to change post featured image using a custom field of category?
- How to add post_type=value when editing that post type in the WordPress admin?
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- CPT Archive with core Category
- Open Custom Post Type as PDF
- Using The REST API How To Pull All Custom Posts?
- Group posts by custom post type
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- Display all posts in main category and 1 subcategory
- Replace li Items with divs with classes
- showing custom post types of a certain category only
- Custom Post Type Loop throws 500 error when used in widget
- Get posts from a custom post type by child categories of a parent category
- Linking to the most recent post in a Custom Post Type
- Custom Post Type Archive Page Filtering
- Show the same Article Available in Other Categories
- Show category ID on custom post type
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- How to create Blog Post Specific Widget
- Storing posts from query and accessing later via AJAX call
- If post has custom field then display css-class
- get_posts() with custom post type does not work outside page.php
- Posts from all the categories are being displayed instead of particular category
- Display only one post each WEEK
- Get parent categories of custom post type
- List children on child post
- Restrict custom post type from appearing with ?post_types=
- How to query_post custom posts within default taxonomy?
- Conditional Statement custom post type category
- Custom Post Type With Categories
- create parent post using wp_insert_post