Custom Post Type Single Loop Outputting Wrong Post
I have been unable to get my single-portfolio.php template to behave properly.
So I have a custom post type called portfolio. I am displaying all of those posts in the front-page.php and it works perfectly fine. Here is the loop for the front-page.php:
For the life of my however, I cannot get the right post to show up in my single-portfolio.php template.
Basically, if I go to one of my posts (so for example, lets say http://example.com/portfolio/test-post/) I end up with a single post page that displays the wrong post (so instead of “test-post” I get “wrong-post”). No matter what post I open up, it will be the exact same post that is displayed (“wrong-post”). If I set the posts_per_page to infinite, it will show me all of the posts.
I have tried many different Loops. I have tried the exact same loop as shown above, as well as the default custom post type loop found in the WordPress Codex.
Any suggestions on how to solve this?
- The topic ‘Custom Post Type Single Loop Outputting Wrong Post’ is closed to new replies.