custom post types - custom template page (3 posts)

  1. Gold56Star
    Posted 4 years ago #

    How do we assign a custom template to a custom post type?

    For example I have a custom post type "Portfolio". Currently it is using the single.php template but I would like it to use a custom version of the single.php template file.

    I've tried naming the template file single-portfolio.php and portfolio-single.php without success.

    Thanks for your help.

  2. Gold56Star
    Posted 4 years ago #

    Figured it out... The modification to the file name needed to match exactly the value used in register_post_type('Portfolio',... so it would be "single-Portfolio.php"

  3. Simon Wheatley
    Code for the People
    Posted 4 years ago #

    That's core functionality… you don't need my plugin for that. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic