Help with the_loop logic

Well @ThemeBuddies, remember one thing… when you create custom post types, there is one important note about both rewrite, and has_archive. These arguments are necessary if you want to
be able to view an index of your posts without having a specific page template dedicated to it.

kod3r said
Well @ThemeBuddies, remember one thing… when you create custom post types, there is one important note about both rewrite, and has_archive. These arguments are necessary if you want to
be able to view an index of your posts without having a specific page template dedicated to it.

I like your idea. It seems simple enough but doesn’t return anything. no posts or pages. I understand the code. It does make sense but doesn’t make sense as to why it’s not working. I am going to look into get_template_part and see if I can figure it out.

Oh, I know what might be wrong. The ‘_wp_page_template’ returns the file name with ’.php’ at the end, e.g. ‘template-portfolio.php’, while the get_template_part function accepts the template name without ’.php’ at the end. You will have to strip that part and you’ll be good to go.

I just change it from get_template_part to include and it’s working fine. Now I am editing the code to make it work in my theme. This might be the solution I was looking for. I don’t see any double posts yet so that is good. Thank you for your help.

P.S
I have been working on this theme for over two months and have spent countless hours googling looking for any tutorials that I could find on how to make a one page WordPress site. As far as I can tell, there are ZERO tuts out there. Since ThemeForest does look for tutorials to post and sell, this might make a great tut for someone who can share the wisdom.