• Resolved MaddTechWF

    (@maddtechwf)


    Is there a way for me to create two “post” templates that will allow me to have a template for my blog and then one for my portfolio?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Will your Portfolio be:

    1) Part of your blog
    2) A Static Page
    3) A Custom Post Type

    Thread Starter MaddTechWF

    (@maddtechwf)

    Hey Chip,

    My portfolio is currently setup to pull based off of a custom post type called “Portfolio”.

    Reference the Template Hierarchy.

    For your “Portfolio” custom post type:

    1) Create a “archive-portfolio.php” as the template file for Portfolio post index (if needed)

    2) Create a “single-portfolio.php” as the template file for the single-post view for Portfolio posts.

    Thread Starter MaddTechWF

    (@maddtechwf)

    So how would it know to use the single-portfolio.php page to load my individual portfolio items????

    So how would it know to use the single-portfolio.php page to load my individual portfolio items????

    Because WordPress is awesome like that! ??

    No, really: the template hierarchy system is setup for this very reason:

    1) Single “Post” Post-type: use single.php
    2) Single “Page” Post-type: use page.php
    3) Single “Custom” Post-type: use single-custom.php

    When you register your Custom Post Type, you assign it a slug, e.g. “portfolio”. WordPress then knows what to do with “portfolio”, and how to apply templates to “Portfolio” Post-types.

    Thread Starter MaddTechWF

    (@maddtechwf)

    Awesome. Thanks Chip. Appreciate the quick help.

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