Forums

[resolved] How to maintain 2 types of page template files ? (4 posts)

  1. cyborg3100
    Member
    Posted 1 year ago #

    well I am looking to use <?php wp_get_archives('type=postbypost'); ?> code in page.php file to display list of all posts. But the list of all posts is getting shown on all pages obviously which I don't want.

    I just want a page /list which shows all the list of posts. How to do it ?

  2. moshu
    Member
    Posted 1 year ago #

  3. mfields
    Member
    Posted 1 year ago #

    cyborg,
    This sounds like a job for a custom page template file. Documentation can be found here:

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    I suggest that you copy all of the code from your theme's page.php file and paste it into a new file which you will save in your theme's directory. Then you will need to add the following to the top of the file:

    <?php
    /*
    Template Name: Post by Post
    */
    ?>

    Save this file and upload it to your server. Then, log into WordPress as admin and go to Manage -> Pages. Select the page that will display the list of post and scroll down until you see the "Page Template" section. Your new page template should appear in the dropdown list. Select it and save your page.

    Hope this helps,
    -Mike

  4. Pnitruc
    Member
    Posted 1 year ago #

    3 months late - but thanks fields this helped!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.