Your older code seems to work just fine, if there were issues with it – something else caused them.
Your updated version seems to take a step back since your loop is written like main loop and is not using $queryObject
that you set up.
Related Posts:
- Display all posts in a custom post type, grouped by a custom taxonomy
- Creating an Image-Centric Custom Post Type?
- Correctly delete posts with meta and attachments [duplicate]
- How do you get the count of posts in an archive page?
- Prevent pre_get_posts filter on specific post type
- How to use a custom post type as front page?
- Search multiple custom fields by using meta_query
- Custom Taxonomy with Custom Post Type Finds No Posts
- Display several random posts, but make sure a condition is met
- Add custom field to media attachment image attribute in post editor
- WP_Query to loop a Custom Field, Custom Post Types do not show
- Retrieving 3 latest post from each of 5 different custom post types
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- How to show posts from multiple post types in a single loop? And display them separately on the same template
- How to create posts (not post template) to be displayed on projects page?
- WP_Query post at custom position
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- exclude custom post type by meta key in wp_query
- Query for posts in 2 taxonomies
- Query Custom Post by Category
- How do you output custom code between posts in the loop?
- How do I Use Nested Loops of Custom Post Types for MultiSite Blogs using WP_Query()
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Unable to get post content from custom post type loop
- Lists Posts from CPT that match the Title of the Page
- Help Structuring Query for Archive Pages
- Loop on front-page.php
- Custom WP_Query doesn’t display all posts
- Query & the_content() is showing in the header
- Move Genesis Single Page/Single Post Title
- get_pagination not working on a custom post type query (using WP_Query)
- WP_Query with custom post type ID
- Displaying multiple post types on home page
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Pagination not working on custom query on a page
- display posts of custom post type with custom taxonomy
- Display custom post type for specific user
- Custom Post type content within a slider
- Trying to add a class to post links
- postsperpage value not being applied
- Display the current post in browser as the first post in a loop (for a slideshow)
- Display post from custom post type
- List all Custom Post Type posts excluding certain Taxnomy term
- foreach loop inside the loop creating duplicates in output
- Add Class according to the order of appearance
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- SEARCH QUERIES – REVERSE OUTPUT
- How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Error in the page of a CPT file in WordPress
- post_type incorrect for custom post type
- Staggering featured post using ‘sticky’
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- My post loop needs to have 8 different post templates
- subtracting the current post form then whole loop, which is generating all CPT titles
- CPT: multiple loops with different terms
- Mix Facebook and Twitter feed into custom posts
- sorting in wp query based on custom field value
- Custom post Query and WordPress Post Query Clash
- Multiple WordPress Sites, Same Database but Filtered Content
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- Only show current category post
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Error in WP Query. If variable is empty it is displaying previous post value
- Strange behavior on WP_query
- get_post_meta for Custom Post Type ( CPT )
- WordPress query posts by custom post type not workng
- How to keep a CPT stick to specific position?
- How To Loop Through list with Custom Post Types
- WP_Query for CPT with filter by another WP_Query
- Is it possible to add query parameters on the archive page?
- Custom Post Type + Category archive
- Loop with Custom Post Type and Taxonomies
- display news with pictures 3 small and one large (loop)
- Post data in separate divs with incrementing class using WP_Query
- How can I pull information from my loop and divide them seperately?
- Delete attachment with post
- Fallback if statement based on the number filtered from it
- Turn post into simple slideshow
- next_posts_link returns same content of 1st page
- Custom loop won’t work, can’t find problem
- Custom post-type’s pagination not working in category.php
- Query Custom Post Type by Tag
- Fourth page of custom post type archive page does not exist
- Catergory args causing loop not to show
- How do I correctly query posts from a post ID?
- display custom post type from register taxonomy
- How to exclude certain portfolios from a loop
- Custom post type and have_posts() return empty result
- How can I show posts with the same tag?
- How to insert a post from a different post type after every nth post
- Sort CPT by taxonomy AND THEN by custom field
- Complex Custom Loop with Includes
- Query Multiple Post Types and Paginate Newly Created List
- SOLVED: Shortcode to display Divi project filtered by tag in WP Query loop
- author archives, showing all custom post types, problem on pagination