Remember: custom page templates are still static Pages, so the default Loop for a custom page template will be the post content of the static page to which the template is assigned.
You need to add a custom query to the template, in order to query anything other than the default query.
Refer to the Codex documentation for creating a custom template for a Page of Posts.
Related Posts:
- How do I find if a page has a template?
- Using pre_get_posts to target a query in the sidebar
- How to display SQL query that ran in query?
- Custom query_var causes displaying posts archive on front page
- What is the most efficient way of implementing a favorite post system?
- Why does get_the_time(‘F j’) return November 30 for all posts?
- Query by one meta_key and sort by another (possibly NULL value)
- Very slow query
- Search Terms – Querying on either description__like OR name__like in the same Term Query?
- Query & Sort Comments by custom comment meta
- Count user posts by user ID, Post type and Post status
- is_archive() doesn’t work on public query var archive pages?
- How to get category link without a database query
- search through post-type attachments titles
- How to count get_users query?
- Possible to get posts from multiple meta keys/values in a single query?
- Most effective use of DB querys
- Difference between fragment caching and wp_cache
- mysql query paging
- How to display all posts with today’s same month and day only?
- Two differents queries in archive page
- Select User by Joining Multiple Meta Value Results
- Show featured image as background image from postQuery
- How to set back query var author_name after unset it?
- Using $wpdb->update but confused on the WHERE in and SET
- My SQL function to change user_name
- You have an error in your SQL syntax – Help with query
- Make one query for adding entries to database
- Order query by post meta value
- add_query_arg() and empty variables inside
- Query Strings and Woocommerce
- Style Post Differently In Query
- List all posts from past week grouped by sub-category
- Query Custom Post Type posts by Keyword/url slug
- WordPress post type “event” query string fix?
- order one custom post type by modified time of another post type
- is_search called incorreclty
- Function to delete a post, it’s children and it’s grand children (half way there already)
- Query to Get All Users from wp_users With NO matching user_id In wp_usermeta
- Nested loop : wich way/order?
- WordPress custom setting page – add flashing message
- Custom query AFTER rss fetch_feed not working
- Limits, not all post are showen when querying for posts by view count
- Dynamically adjust single-posttype.php query, based on current taxonomies
- Multiple Category Query
- wp_list_pages() refuses to output posts
- Can’t seem to do combined query AND sort?
- Use mysql_query instead of $wpdb query
- sort query results by newest
- Post with certain term and without any term
- Custom Query – Based on user input
- How to reset usual $query on search page to push custom $wpdb query there?
- Change the destination of the URLs in post.php
- Page with custom template make get request to a custom route – Pseudo code
- get_users with array as meta_value
- How to exclude posts for current user
- Valid SQL query return empty
- mysql query – how to escape apostrophe?
- Query the WordPress database to get data together with replaced information
- exclude pingbacks from wordpress SQL query
- Query for Custom Post Type UI Does Not Loop All the Post
- wp_posts query slowing down my website
- Updating with $qpdb->query() always returns 0 rows affected
- Get the_field of Advanced Custom Fields in a custom query [closed]
- Advanced Custom Fields – Relationship post foreach query
- How do I query for posts by custom meta and those that have been stickied?
- Select min/max meta from query
- How to add a Variable to post query
- get products by custom date variable
- Sort a list of a CPT ( job) if a meta is empty
- How to delete all images from code in all post_content
- How to sort by two meta keys in admin area?
- Restrict WordPress search to a single ACF field
- wp query multiple values > display a specific value first
- PHP Fatal error: Uncaught Error: Call to a member function insert() on null
- Nested select statements not working
- Restore WordPress Backup Locally?
- Trouble migrating custom post types from non-wordpress cms
- Pagination adds search query (again)
- “order” does not affect order of custom query
- Create a new post on a specified publish date via link?
- Exclude Posts from a Widget
- New custom post type entries are not sorted correctly in admin using pre_get_posts
- Query String for the WP_QUERY parameters
- $wpdb query for price in custom field value
- Run an update query in a function
- Add generic page to WP_Query
- Advanced Custom Fields Query with Different Values of the Same Key
- No results for taxonomy archive page
- Multiple terms not working on taxonomy
- Sorting of coupons in the right way
- excludeCat function reverses order of blog posts
- Run search query again without pagination gives no results?
- Filter the feed page post limit
- Filter multiple different main queries on custom pages
- WP_Query orderby meta key/value suddely stopped working
- WP_Query older new links navigation?
- Where can I find the SQL to get the most used information by wordpress database?
- WooCommerce Total # orders [closed]
- How to figure out correct wp_options to have autoload=’yes’