I’d guess that the get_sidebar()
inside the loop is causing the problem. It should be outside the loop.
The way it is now, one post is displayed, then you call the get_sidebar()
code, which displays the sidebar stuff, then the loop continues with the next post.
Move the get_sidebar()
outside the loop.
Related Posts:
- Custom page sidebar using Template dropdown box
- What is singular.php?
- Custom Post Type Data in Sidebar widgets?
- What are the differences between custom post type and custom page templates?
- Page Template as Custom Post Type Archive
- Setting a custom sub-path for blog without using pages?
- Add Content to Page without shortcodes
- Including Custom Post Types in “Recent Posts” Widget
- Loading custom page template via plugin
- Post formats “audio” and “video” only showing in index.php
- Ordering Posts List By Taxonomy Terms?
- Creating a Custom Post Type for Inserting Preset Content into Post & Pages?
- WordPress keeps fetching the archive page instead of the template page
- How to add custom template in plugin?
- How to quickly switch custom post type singular template?
- Add a Template to a custom post type
- How to use a dedicated template for the Custom Post Type from a plugin?
- WordPress calls archive page instead of Custom Page Template
- How do I Make a custom post type get a custom post template in a plugin
- How to sort list of custom posts to get view like a tree of posts under categories and their children’s categories?
- Assign Page Template Within A Custom Post Type
- Dynamic page.php template for custom post types
- Custom post type archive and single.php files not working
- Page Templates – this code only works for one Custom Post Type
- Pagination on a custom page template
- Custom Post Type – Archive page title
- WordPress custom post type Single.php?
- Multiple templates for custom post type
- How do I create a custom post type for a training CMS in WordPress?
- Custom Post Types, Page Templates and Pagination. Why do I get a 404 Error?
- How do I create a page template to display a custom post type?
- How to make an archive page displaying posts in a date range
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Custom Post Type slug same as page name causing a conflict
- Control Custom Post Type template from a plugin
- Detect if 1st, 2nd or 3rd level custom page?
- Create second custom 404 page for selected post type
- is_page_template not working as expected
- Child page in custom post throws 404 page not found
- CPT: archive-cpt.php VS custom page template
- Multiple portfolios with one custom post type?
- Take Variables Set in Functions.php and Echo Them Inside My Custom Post Template
- Hyphens instead of Underscores in Post-type Archive Template Filenames when Post-type handle contains underscore
- Including Custom Post Type posts in a page template contextually (or should I widget?)
- Help with CPT template pagination
- Custom Blog Post Listing in Genesis Sample Child Theme
- After updating a page, all pages on the site used the index.php template
- Page Templates Drop Down Select for Custom Post Types
- Pull in custom content types into page template
- Editable content on a Custom Archive page
- Using custom page templates with plugin [duplicate]
- Can I make WordPress use a custom template for a child page
- Troubles with making a custom template for posts
- Display custom post data in sidebar w/ dropdown
- Create Template for Custom Post Type same like for Page
- Creating a Page to View the List of Posts for a Custom Post Type?
- How to load a template without it being assigned to a page/post?
- Change archive page template using pre_get_post
- Custom template with CPT doesn’t display on frontend
- Custom Page that comes with preloaded content for the user
- create a template page for a post
- Custom post type archive page template
- Custom Post Type with Templates using Meta Boxes?
- Posts are duplicating on wp_post_update
- How to make this menu drop down or like accordion
- Custom-Posttype & Custom Taxonomy WP_Query
- Page template with different page and post content
- Random image from tag/custom type on sidebar
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- WordPress CPT save metadata in gutenberg
- redirect automatic page that serves custom posttype content
- WordPress showing archive.php instead page
- customise template to only show custom post type entries
- How to render a custom post type template with custom fields using shortcode
- Show Custom Post Type meta boxes only on Page Edit
- Adding the_content() in custom template email
- Creating a Page Template to display all items from a Custom Post Type
- Filter widget outputs
- Why does my content disapear when I make a page to match an archive name?
- Custom Post Type Template Alternative
- General advice on addressing content-centric pages
- Fields for different parts of a page
- next_/previous_post_link() `in_same_category` appears to fail when true
- Multiple templates for single custom post type
- How do you create a custom template to display a category with an image and related posts below?
- WordPress Custom Search by post_type
- Pages Become “Archive” Instead of Using Page Template
- How can I set the page template of a new custom post type post?
- Custom post type pages return 404 page?
- Multiple single templates?
- Custom URL redirect in WP
- WordPress Picks Up Wrong Template for Custom Post Type Archive Page
- Associate page w/ specific single post template?
- Include php on a specific page template
- get comments by current user inside page template
- page template for custom post type
- Page Template Dropdown For Custom Post Types
- why is the current page title being output?
- How to integrate single and archive templates for custom post type in any WordPress theme
- providing access to post_id or post inside functions.php