Strictly, you don’t need to use a loop in a page template, but it doesn’t hurt, the content of the page will still load, the loop will simply only run once as there is only one post/page. Many themes include a loop in page templates, I guess for some compability issue.
If you are building your page template from scratch, you don’t need to add a loop to it, you are right, wordpress will get the right content from the URL, but you still need to run the function the_post() before to use template tags like the_title(), the_content(), etc. Just put the the_post() towards the top of the template.
Hope it makes sense to you, don’t hesitate to ask if you need further clarifications.
Related Posts:
- How can I loop into two different DIVS without repeating the DIVs
- WordPress loop specific thumbnail size
- Syntax error when I try to insert my loop into an unordered list? [closed]
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Why in my theme I can’t see all the statics content under the posts?
- Get all posts as an array ID => Name
- home.php show blog posts as grid view
- Search.php gets metadata from first post
- Check if current post in loop is last on current page
- Looping through dummy posts and showing them in the main index.php
- Problems with the WordPress loop [closed]
- WP Knowledge Base Theme bug – Subcategories and Articles, Need to change WP_Query
- Trying to display ads on only a third of posts in a loop. Keep getting Error 500?
- Pagination not working properly
- $_html is empty when var dumped
- Why have on every line
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- reason of splitting theme files to multiple files
- Why isn’t my if/elseif/else working correctly here?
- How to use SRCSET with get_the_post_thumbnail()?
- Post from one loop in different containers?
- Custom Loop Pagination on WordPress
- delete an array element when its date expires
- List authors with posts in a category
- Understanding WordPress child theme custom JS loading
- User Defined order on get_categories?
- Is the regular ajax request method safe or I should use admin-ajax.php?
- How do I translate this string – PHP syntax question
- Can I change a variable in a content part while calling it?
- When would you use $_post instead of $post?
- Remove annoying WP Adminbar CSS
- Must Use Plugin Causing Query Error
- Exclude posts from homepage having a specified tag
- Advanced Custom Fields: Post Object – Not returning data [closed]
- Changing the template hierarchy
- Set WordPress Default Template
- How can I add multiple ‘tax_query’ arrays via a loop?
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Pull the content out of a page
- adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again
- Avoid parallax images hardcoding
- Blog posts repeat
- Checkbox doesn’t stay checked, conten
- List posts that don’t have a specific tag?
- if statement with is_active_sidebar()
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- Add content after the first post in WP Loop
- Display an image if odd number of posts in grid
- Show About and Contact Us page when they’re clicked in the top menu.
- 2nd page displaying the exact same posts as my first page (minus the very first post)
- Is the 404 page automatically displayed if a loop returns nothing?
- How to specify the path for require_once in a child theme?
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- wp_nav_menu not working correctly in my underscores theme
- use loop to return blog details
- get_page_template_slug returns incorrect path
- How to add post meta in while loop?
- How can I search all plugins for composer’s vendor/autoload.php?
- Calling function in loop causes repeat data
- Is there a hack for using is_page() within the function.php file?
- How to Generate a list of Most Commented post?
- Extract and display user infromation on an automatically created page
- How to pick “full/thumbnail” images in the loop?
- How to Fix an Archive.php That Displays All Posts?
- How to add ASCII symbol after each recent post [closed]
- How can I assign separate stylesheets to different pages?
- How to tell if a user has gone in and created a menu
- Fatal error: Cannot redeclare comment_theme()
- the_post(); prints out style text into my HTML?
- Displaying images outside the content
- “WARNING: Found @$ in the file __ Possible error suppression is being used
- How to print all the inline styles in the WP_Styles instance together with their keys?
- Create dashboard widget for custom theme support
- Create category after theme setup and modify the default one
- Display attached images of a page or post that are insetred using gallery
- Accordion headings cuts off to second line on collapsing a accordion heading (used acf repeater)
- WordPress Recent Posts – Loop
- ACF background-color per post in a WordPress loop
- Advertisement in Loop Posts wordpress
- Theme editing “post thumbnail” help
- Adding custom PHP to existing loop in Genesis
- How to Pass Current Taxonomy Terms into new WP_Query?
- Use Custiomizer to setup meta theme color tag
- Where can I find the declaration of `$_wp_theme_features`?
- Click to expand menu
- Loop returns more items than exist?
- Display tab title as ‘blog tagline | blog title’
- Modify category archive page loop on functions.php
- WP_Post is not from correct array
- Post formating on Home page
- divide custom field values in div every two values
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Limit ads appearing more than three times
- Pagination on Custom Loop
- WP multisite network plugin fails to see classes loaded with spl autoload
- Custom single.php files for different post formats
- Troubleshooting “loopback requests that take too long”
- Help with if/else loop [closed]
- Headers already sent error with get_template_part in REST API call
- How to hide header and footer from page template