Assuming your custom post type is named “job_posting”, you just need to change your query to read:
$query = new WP_Query( array( 'post_type' => 'job_posting' ) );
This can be found in the official documentation.
There’s a lot more parameters you might like to use too – you can find a full list in the documentation I linked to. Some I’d recommend considering would be posts_per_page
(so you don’t get everything returned at once), and setting post_status
to ‘publish’ just in case any draft/private posts get returned (which they shouldn’t anyway, but I like to be safe 😉 ).
Related Posts:
- Query all posts where a meta key does not exist
- AJAX search on post pages by custom post type
- Select All in Parent Category, Group by Child Category?
- Filtering a WP_Query meta_query by numeric values isn’t working
- “pagination” (but not really) and queries using custom posts types
- Pre_get_posts Gives 404 on Custom Post Type
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- Query for posts from any post type but only add instock products
- Query not returning CPT posts
- Custom Taxonomy and tax_query Issue?
- WP_Query with custom post_type and cat retrieving unwanted posts with the custom posts
- Query to get the author who having maximum number of post (custom post type)
- Pagination not working
- Display all Posts and only certain Custom Post Types with meta fields
- Select menu should display categories and the item’s depth
- Custom Post Order for a Custom Post Type
- Show Post Count of a Category
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Lists Posts from CPT that match the Title of the Page
- Filtering by Post Meta Custom Fields – Performance
- WP Query—Relationship between two custom post types and their fields
- Unable to get paginate_links working with a custom query [duplicate]
- Setting proper query for multiple custom admin filters
- Query custom post type with tags
- Pagination for Custom Taxonomy Page [duplicate]
- Custom loop with multiple taxonomy queries
- Isotope Filtering with Bootstrap Tabs – Custom Post Type Query Loop in each Tab (Have to click twice to filter)
- Custom taxonomy rewrite give pagination 404
- WP_Query order by custom field, then randomly order some of results
- creat filter with wp_query
- How to do WP_Query with two meta fields with orderby clause
- Get Posts by multiple custom fields is not working
- Custom query at top of archive search page, arguments are overridden
- How to display post list inside post
- Sort entries by date mixing two post types
- Advanced search form with filters for custom taxonomies
- custom post type search by reference id
- Showing specific post in order of array wp_query
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- Print current post category during WP_Query
- Multiple Custom Post Type queries, how to DRY it up
- Custom WP_Query always respond with 200 status even when no entry
- WPDB for post count on post
- post_per_page ignored in WP_Query
- Pagination 404 on Index with custom query
- How to include category name/id in wp_query for retrieving “custom post type” from a particular category?
- Cannot get custom post
- Custom post type and standard post not displaying or working
- Display custom post type for specific user
- Get all post from a post type
- Trying to add a class to post links
- A faster way to query custom post types with multiple conditions?
- Custom Post Type Archive Pagination
- WP_Query: Posts within category OR custom post type
- Two queries – one with checkbox ticked, one without – comparing meta_query
- Custom post type pagination error
- WP query_posts group by meta field related
- posts_per_page in custom WP_Query does not override “Reading” settings?
- WP Query from two Custom Post type fields as statement
- Display Parent-Child Posts in specific order by comparing IDs in array
- Apply category query clause to posts of custom type
- custom post type and a “sticky” position taxonomy
- WP_query has incorrect wp_posts.post_name = ‘asc’ when I have custom post type called ‘order’
- How to sort by multiple values in a nested WP_Query
- SEARCH QUERIES – REVERSE OUTPUT
- WP_Query to display number of custom post type filtered (order by) taxonomy
- 2 modal windows with ACF content on Archive page
- post_type incorrect for custom post type
- Live search by custom tag
- Custom Post Type – Display all, wrap in groups of 3
- Staggering featured post using ‘sticky’
- Ajax load more inside custom post type taxonomy
- How to get the posts that my following users are liked?
- Only show categories that have posts within custom post type
- Create a custom wp_query from a specific custom post type with specific taxonomy
- SQL LIKE in WP_Query
- How can you use a page for a custom post type?
- Display all Custom taxonomy terms and their relevant custom posts
- Query breaking with ‘posts_per_page’ => -1
- WP Query with multiple post types ordered by custom meta date then published date
- CPT Efficient way to display posts from different categories with custom query
- How To Loop Through list with Custom Post Types
- CPT or Custom Table for Repository of Serial Numbers
- Query Pulling the same post twice
- Use Tags to Query Associated Multiple Posts and Get The Average Of Custom Field Values
- Custom Post Type + Category archive
- Values inside a custom field to determine which category posts to display
- How do I sort post listing by child post count?
- Pop up showing same content on all posts display.
- Custom post-type’s pagination not working in category.php
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Querying meta values within an array
- Count of posts with meta_key filled in?
- Filter Custom post type by another Custom post type
- Are custom posts included when getting a categories’ posts?
- Query order by meta value force specific tag first
- WP_Query() displaying past post / event
- WP Query Conditionally query meta and taxonomy