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
- 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
- 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
- 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?
- Lists Posts from CPT that match the Title of the Page
- Help Structuring Query for Archive Pages
- Loop on front-page.php
- wp_query to find posts by year and month
- Custom Post Type Loop within Shortcode
- How to insert content from another Custom Post type into Post?
- WP_Query | ‘post_type’ doesn’t work
- Filter by custom taxonomy slug on a custom post type
- Query custom post type in the loop
- Loop through Custom Post Type, and then show children within each iteration
- Very Slow Page – How to Optimize # of Queries?
- Custom Post Type – List all attachments on Edit Screen
- Can I create a loop with multiple post types and specify different $args for each post type?
- Display CPT posts based on specific taxonomy
- WP_Query orderby modified to include custom meta changes
- get_attached_media() on author page not working
- How to make sure content doesn’t display if selection is empty
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- Custom loop with multiple taxonomy queries
- List custom taxonomy specific to one custom post type
- How can I get the number of custom post type posts that have a specific attachment image set?
- What’s the WP way to load remaining custom posts?
- WP Query with categories only shows one post and ignores the category
- WP_Query custom post type query not showing the exact post type
- How does order=asc effect a wp_query (its acting pretty weird in a loop)
- Wrapping x posts in html without leaving empty html
- How can I group posts by months and years?
- Multiple Custom Post Type queries, how to DRY it up
- Loop increase number
- Using wp_query to modify the loop in index.php for a CPT
- Custom WP_Query doesn’t display all posts
- Query & the_content() is showing in the header
- Move Genesis Single Page/Single Post Title
- Displaying multiple post types on home page
- Pagination not working on custom query on a page
- Display custom post type for specific user
- Trying to add a class to post links
- Display post from custom post type
- List all Custom Post Type posts excluding certain Taxnomy term
- Add Class according to the order of appearance
- How do I list a custom field and custom taxonomies for each result in a loop?
- Custom Post Type Query W/Category Dropdown
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Custom post type pagination error
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Related “custom post type” using “custom taxonomy”
- Is there a (preferable built-in) way to check what custom queries are used in a theme?
- Page that lists publications by classifying them by taxonomy
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Exclude a specific post in a Custom Post Type
- Pin posts to top of custom loop
- Filtering posts based on three taxonomies
- WordPress next post by ajax call on button click
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- 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?
- Error in the page of a CPT file in WordPress
- post_type incorrect for custom post type
- Staggering featured post using ‘sticky’
- My post loop needs to have 8 different post templates
- Mix Facebook and Twitter feed into custom posts
- Multiple WordPress Sites, Same Database but Filtered Content
- WordPress query in which condition uses custom field
- Error in WP Query. If variable is empty it is displaying previous post value
- Strange behavior on WP_query
- How To Loop Through list with Custom Post Types
- Custom Post Type + Category archive
- display news with pictures 3 small and one large (loop)
- Post data in separate divs with incrementing class using WP_Query
- 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
- 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?
- Query Multiple Post Types and Paginate Newly Created List
- SOLVED: Shortcode to display Divi project filtered by tag in WP Query loop