• I want to show a custom post type for “recent press” items – so they don’t appear in the blog. Anyone know how I can create a page – that’s like the blog – but only displays this custom post type?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Depends what you mean by “recent press”. If that is a set of posts that can be given that category, then you can give those posts the category “recent-press” and then your page will be example.com/category/recent-press/

    You can copy the “custom-page.php” and then save as the page title that you’d like it to be.

    Whatever posts you’d like to filter create a category and make sure all the posts you’d like to filter into the custom page have that category associated with it.

    Then in WP-Admin, go to Posts and click categories. Then in the list hover your mouse over the category you’d like to pull into your custom page…(in Firefox) at the bottom left of the browser window – you should see the URL..plus this snippet “category&tag_ID=34” – or whatever number is associated with that ID. Record the number and then post this bit of code in your custom page file

    <?php query_posts(‘cat=34’); ?>

    This is telling the page to only pull this category type.

    You also need to go in “index.php” and in the same post query php statement as above tell it to stop displaying this category in all other pages so it would say

    <?php query_posts(‘cat=-34’); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Page Templates’ is closed to new replies.