WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] HELP!!! (2 posts)

  1. MaddTechWF
    Member
    Posted 4 years ago #

    I recently changed how my pages are referenced through the permalink setup. I created a page called portfolio and I want to use a custom template for my portfolio section. How do I create a custom template for my page to pull for that section?

  2. ClaytonJames
    Member
    Posted 4 years ago #

    From the folder of the theme you are using, make a copy of the page.php file. Change the name of the copy to portfolio.php.

    Open your new portfolio.php file with a plain text editor, and at the very top, on the first line, paste this in and save the changes.

    <?php /*
    Template Name: Portfolio
    */
    ?>

    Now upload the portfolio.php file back into your theme. Go to Dashboard > Pages > Edit and edit the Portfolio page you mentioned you already created. In the page template drop-down list on the right side of the editing area, you should now be able to choose the new "portfolio" page template you just created and uploaded to the theme folder. Apply the page template, save the page, and you should now have a Portfolio page with a unique template that can be edited to suit your requirements. Any edits you make to the portfolio.php file, should now be reflected on your Portfolio page.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.