Trouble Displaying Custom Post Types
-
I created a custom post type “news” which I want to display on a separate page from my blog.
I created a functions.php file in my child theme (based on the twentyeleven parent) and so far so good. The new custom post type shows up on my dashboard. I made sure I set both ‘has archive’ and ‘public’ to ‘true’ if that matters.
But I want to have the list of news items display on a separate page from my blog. So I copied the page.php template over to my child theme. Renamed it, then added a template name (so it would show up in the drop down menu under pages) and added the following line of code before the loop, which I got from researching the internet:
php query_posts( ‘post_type=news’); ?>
I created the page to display the list of news items and chose the template I created from the drop down menu. But when I visited the page it show only my blog posts. What am I doing wrong? Thanks
- The topic ‘Trouble Displaying Custom Post Types’ is closed to new replies.