Forums

[resolved] creating new pages with templates (8 posts)

  1. noisetheory
    Member
    Posted 3 years ago #

    hi guys, had a search but didn't turn anything up.

    want i'm wanting to do is create more pages based on index.php (which by default loads the index.php from the template directory).

    example to begin i'd like to duplicate index.php as say reviews.php, and have this load the content of 'reviews.php' in the template directory. At this stage if i create an exact match of index.php as reviews.php in the main site folder, reviews.php will still load the index.php template file. I'm a little confused as to the coding of wordpress to change this.

    any ideas or workarounds?
    thanks

  2. moshu
    Member
    Posted 3 years ago #

    If you want reviews.php to be a Page template - read this:
    http://codex.wordpress.org/Pages#Page_Templates

  3. noisetheory
    Member
    Posted 3 years ago #

    thanks i'll take a look

  4. noisetheory
    Member
    Posted 3 years ago #

    ok, maybe i'm having a bad day.. but how can i get a page to use the 'reviews.php' template in my templates directory?

    say with a link from my main index page?

    thanks in adv

  5. moshu
    Member
    Posted 3 years ago #

    I am the one who is getting confused :)
    Maybe we are not talking about the same thing?
    Template files are all the files in your theme:
    http://codex.wordpress.org/Theme_Development#Theme_Template_Files_List
    Pages - a specific feature of WP, different from posts:
    http://codex.wordpress.org/Pages

    When you create a new Page in admin > Write > Write Page, you can select (on the right) which Page template to use to display it.
    Note: if you have only 1 (one) Page template in your theme, the option to select a template will NOT be displayed. You need at leats the default page.php AND another Page template.

  6. noisetheory
    Member
    Posted 3 years ago #

    i think what you've said should suffice, i wasn't aware of the template selection when adding a new page.

    basically, i want an album reviews section. i've got a plugin for adding them (to allow for extra data), but obviously i'd like the album reviews pages/archives to appear different to the other standard news/etc archive pages.

    i also want to be able to link to the latest album reviews from a side menu on the main page, which i think i'll be able to achieve using what you've mentioned.

    i've no problem coding straight php/sql queries to do it all, but i'm trying to keep it integrated with wordpress as much as possible.

    if you have any other suggestions let me know. thanks for your help.

  7. moshu
    Member
    Posted 3 years ago #

    i want an album reviews section.
    So, why not use categories for that?

    Just to make it clear: on Pages you cannot display multiple content! (well, you can, it takes a lot of useless work)

    The simple way for you should be NOT Pages but Category Templates. (that's why it is always better to tell what you'd like to to achieve - it's easier to get an answer)

    Summary. Make your reviews a category and display them on a differently designed Category Template.
    http://codex.wordpress.org/Category_Templates

  8. noisetheory
    Member
    Posted 3 years ago #

    ahhh, so i've gone looking the long way around to get a pretty simple result in the end.

    thanks for your help, much appreciated. i should probably start reading some docs.

Topic Closed

This topic has been closed to new replies.

About this Topic