WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Separate Post and Page Files?? (4 posts)

  1. Altstatten
    Member
    Posted 7 years ago #

    The theme I'm using has only one file for posts and pages, the index.php file.

    I want separate files for each, one for posts and one for pages so that I can format them differently.

    1. How do I create those separate files and get wp to recognize them when I draft something?

    2. Any easy way to go back and "re-assign" the new files to old posts and pages (to adopt any updated formatting)?

  2. moshu
    Member
    Posted 7 years ago #

  3. Altstatten
    Member
    Posted 7 years ago #

    That did the trick for the Pages. I applied this:

    The files defining each Page Template are found in your Themes directory. To create a new Template for a Page you must create a file. Let's call our first Page Template for our Page snarfer.php. At the top of the snarfer.php file, put the following:
    <?php
    /*
    Template Name: Snarfer
    */
    ?>

    Is there an equivalent procedure for POSTS??

  4. moshu
    Member
    Posted 7 years ago #

    Yes, it is in the first link I gave. It is called "single.php".
    (I hate when people don't read the provided resources)

Topic Closed

This topic has been closed to new replies.

About this Topic