Custom Page Templates (3 posts)

  1. josherman2k2
    Posted 1 year ago #

    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?


  2. ElectricFeet
    Posted 1 year ago #

    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/

  3. suitelady517
    Posted 1 year ago #

    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'); ?>

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic