If you are still stuck, one possible alternative is to get all Post ID’s by the custom post type. You could try something like this:
$the_query = new WP_Query( array(
'post_type' => 'my-custom-post',
'posts_per_page' => -1,
)
));
while ( $the_query->have_posts() ) : $the_query->the_post();
the_ID();
endwhile;
It would require you creating a custom post type, and associating posts to it.
There are ways you can associate page templates to posts, but as far as how WP_Query would work from that point with that process, I still have to learn 🙂
Related Posts:
- Show single post then all posts (with pagination)
- Pagination for custom query on single.php
- WP Query Category Atribute Not Working
- Is_single() conditional tag returns null in query
- Include latest author posts with pagination in single template?
- How to use WP_Query() on single.php?
- What is wrong with my WP_Query Arguments?
- Links in the_content not linked
- show related articles in single.php template
- Related Posts with removing some categories
- WP_Query shows all posts on single post pages
- Get Child Custom Post Content on Single.php?
- How do I query for posts by partial meta key?
- Display products from specific category in shop page
- How to uniquely identify queries?
- meta_query where value is equal to given value
- Query by meta_key and order by meta_value_num return orderby date
- How to display most recent posts that haven’t already been displayed with WP_Query?
- What is the difference between these two custom queries?
- WP Query post meta value
- Display featured products through custom loop in WooCommerce 3 [closed]
- Query wp_usermeta alongside wp_users
- Understanding the use of wp_reset_query();
- Multiple WP_Query loops with Pagination Not Working
- WordPress posts per page WP_Query
- WordPress WP_Query orderby being overwritten
- Multiple meta queries but arrange by specific meta value order
- WooCommerce Only OnSale Products Loop Snippet [closed]
- What format does the meta_query TIME type require?
- WP_Query date_query – Use unix timestamp?
- WP_Query last five posts, simply ordered by meta_value
- How to display specific posts with WP_Query?
- WP_Query “OR”: Find posts by ID, Name or Post Title?
- What is the random string I am seeing when I use get_query_var?
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- How to get all child pages in their parent page?
- WP_Query order result by date AND meta_value
- How to display summary content from a Page (Not a Post) on another page
- Custom Search Not Consistent with Results
- how do we display all posts from a particular category in homepage?
- Display both standard posts in a specific category along with a custom post type in a single loop?
- Orderby is working with one query but not with other
- Is there a way to work with a specific the_field from an already queried post? [closed]
- Add capabilities via plugin for another plugin
- Two loops on archive page
- How to order posts by title after they have already been sorted by category
- Filter and Order by Multiple Custom Meta Values
- Meta Query relation “AND” then set array accordingly
- Query with meta_query and tax_query together not working properly
- Adding a tax_query to a WP_Query Object
- wp_query search not taking keywords with together for multiple words
- Adding a html class based on post count
- meta_query fails to compare on values containing apostrophes
- Combine 2 arrays in a query parameter
- Add ACF field in a query
- Set front_page programatically after user login via query, while leaving site option alone
- How to Display Shortcode in the correct location, currently displaying before content after Page Title?
- Filtering posts by archive showing all years
- Find all product ID from array of customfield
- WP_Query posts_per_page strange caching
- wp_query show all values
- Hiding carousel indicators if there’s only one post
- add_query_arg to compare and display events from a certain date
- WordPress dynamic AJAX query
- WP Query get only 1 post (sticky, not sticky etc)
- How to query all posts in CPT + only posts with custom tax in another CPT?
- Order post by modified date
- Redirect logged in users from a custom post type archive page if they don’t have a specific role
- Custom query to retrieve oldest post and retrieve others with date interval
- Custom order revolution sliders post base slides as inserted in Specific Posts List field
- How to display Woocommerce products list by tag
- How to search posts by title with special characters in WP_Query?
- Query postmeta based on meta_value, return array of post_id
- WP_Query: Query posts only if their access is restricted to logged user’s role
- datetime picker, timestamps and meta queries
- Meta key in wp_query bug?
- How can I create another instance of my custom shortcode
- How To Call WP_Query From A Subdomain?
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- WP_Query for attachments without duplicating post_parent and displaying tagged image
- Post OrderBy slow performance
- Showing posts from 4 categories along with all latest posts
- Searching in specific custom post type
- WordPress pagination returns the same posts
- WordPress extremely slow when using get_posts with multiple meta_query relations
- Refresh wp_query with no changes
- SQL query into to WP query
- WordPress WP_Query Search (‘s’) With Multiple Search Terms
- I want to place a post before all others from an ACF boleen field
- Search results stuck on page 1
- How to put posts with some taxonomy on top of others in `pre_get_posts`
- wp_query, calculate with two dates when ‘key’ is text format
- Use value from meta key array for use in WP_Query
- WP_Query sort by ACF date field (newest first) with blank dates first
- Pagination only showed when no category is set in wp_query
- taxonomy-{term}.php terms pagination returning 404 after a certain page
- Using WP Query, I want to include all posts in category 1 as long as they are not also in category 2
- Prevent URL Parameter Affecting other WP Query
- Sort by multiple columns using get_posts
- WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)