What happen if you proceed with the following syntax?
<div id="container">
<?php if( have_posts() ) : while( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><?php the_title(); ?></h2>
<div class="entry-content">
<?php the_content(); ?>
</div>
</article > <!-- /#post-<?php the_post_ID(); ?> -->
<?php endwhile; endif; ?>
</div> <!-- /#container -->
The additional things added:
post_class()
- HTML5 semantic tag
<article>
, and - The Loop
And:
Never ever repeat same ID on a single view
Related Posts:
- Using single.php from plugin folder instead of default template folder
- Can’t get the_content of the parent page from its single post?
- Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?
- Add wp-link-pages to post
- Get current post’s child page?
- Insert Shortcode exactly at the end of the content
- Get current menu_order
- Get content from one page and show it on another page
- get_children() Not Working with orderby Parameter
- Post/Page Publish/Update button not clickable once I make an edit
- Custom Field in Featured image for A particular post
- Custom permalink structure only for default posts
- How do I create a link that will always show the latest post?
- Is there a WordPress equivalent to MediaWiki templates
- Getting an alphabetic post list with two letters onclick on letter
- Pagination not working on Custom Page Template
- Is it possible to show a different WP menu when using password protected pages?
- Multiple loops in same page, without duplicate content
- Include related posts on a page
- why does HTML Tag not working in Post and Page
- How to add shortcode tags in single.php [closed]
- problem to delete page
- Redirect before post page
- $post object is null
- How to display different single post template based on author?
- Convert a complex webpage into WP theme
- Add code just after Post content
- Single post as homepage?
- Pagination on single post page?
- Should a photo gallery be in a post or on a page?
- How can I pass the ID of a post to a page template by clicking a url?
- Multiple loops are not reset
- Why aren’t my posts/pages showing up in my WordPress Theme?
- Adding buttons to Add New Post and Add New Page
- 301 (static page instead latest posts)
- Static posts page with home.php
- Posts vs Pages and categories
- How to dynamically parse and transform post/page content before displaying it?
- is_page Funtion for Posts ?
- WordPress Query Posts From Category Post on Static Page
- Intercept page request and add value to it
- How to create a page that shows the last 10 posts?
- $_GET parametters not working in an specific template
- get_children returns older images
- get_previous_post() while accounting for sticky posts
- the_content() Not Grabbing All Content
- Detecting current page from class method
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- I don’t want the complete article to show on homepage
- Change Author Name to Sitename on Frontend
- Display on page every post in blog WITH comments
- Showing recent post of category in page
- HTML Inside of Shortcode Breaks Shortcode Output
- posts going to 2 pages/categories only show up in 1
- Have posts included on a page that share same category
- Preview page/post revisions without overwriting current content
- Link from Post to Another Post Via Clicking on Words within Original Post
- Link to older links
- Organization of time insensitive content
- Archieve page, Advertisement Every 3 Posts
- Prevent duplicate pages from being added
- Can I style single post that are in multiple catergories?
- What would causes search to return incorrect results?
- Separate blog and reviews categories
- WordPress – When visiting a `single post/ single.php` my category menu item link becomes active
- Edit post & page option does not display on latest wordpress
- Is there a way to find all posts with Youtube video embedded?
- How do I change the template specifically for single posts?
- Show single post child category from a determined parent
- Change the size of the featured image for post?
- Go back to the exact post page number
- WordPress empty page! what is wrong with this code?
- Add CSS and JS files of the template post on a WordPress page
- Can’t find webpage on All Pages or All Post menus
- Remove status ‘archived’ from the default post and page view
- Parent menu item does not display posts when I add the sub-items
- How to distinguish pages created by woocommerce?
- how to put post customized in page
- Show code only on WooCommerce Pages
- Count posts for pagination
- Custom permalink for wordpress page / post
- Multiple Pages – Seperate blogs
- How to add post under particular pages? Like website.com/page1/post1
- I lost the link to my posts in my menu bar
- Posts are not showing up on next page.
- How to give priority to page than to posts permalink structure?
- Only show related posts when another post has same term
- Posts in Page – How to customize the URL?
- Display only current page -> posts tags in page
- Display all posts/pages in a multiple selectbox
- How to mix pages and sub-categories in a url
- How can i add new post on new page
- Make a custom URL and link to custom Template
- Cant retrieve $_POST inside page, just header
- how to style an individual page in a category [duplicate]
- Posts and pages not getting published
- CSS – Change height of Storefront / WooCommerce product categories, but not products
- Cannot Create a new Post [closed]
- No matching template found when using single.php
- How can I use wp_after_insert_post with $current_screen?