Forums

custom post types - custom template page (3 posts)

  1. Gold56Star
    Member
    Posted 6 months 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
    Member
    Posted 6 months 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
    Member
    Posted 5 months ago #

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

Reply

You must log in to post.

About this Topic