Forums

[resolved] Linking to a page template (10 posts)

  1. xercs
    Member
    Posted 4 years ago #

    I'm a wordpress newboy and have been struggling with Creating my own Page Templates. I have read the documentation below but it doesn't mention how to then access the Template you have created.

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

    I have a template with :
    <?php
    /*
    Template Name: gallery
    */
    ?>

    But I now wish to call this via a URL link and can't find any info. Please can someone help??

    Thanks,
    Paul

  2. Jeremy Clark
    Moderator
    Posted 4 years ago #

    You'll need to apply that template to a page you create through the write page section. If you look in the right hand sidebar there will be a box for selecting which page template to use.

  3. xercs
    Member
    Posted 4 years ago #

    Thanks very much. How then can I link to such a page as a URL from my navigation menu ?

  4. Maxaud
    Member
    Posted 4 years ago #

    just as you would any other page.

    say you choose the template "gallery" for your "about" page that comes on wordpress.

    when you go to the "about" page it will have the "gallery" template applied to it rather then page.php/index.php

  5. xercs
    Member
    Posted 4 years ago #

    Thanks but my questions is how do you link to the "about" page from somewhere else?

  6. chazbeaner
    Member
    Posted 4 years ago #

    should just be:

    <a href="[BlogURL]/about/"></a>

    am i missing something?

  7. FrankRichards
    Member
    Posted 4 years ago #

    Jeremy,

    I'm using version 2.3.3 and I can no longer find that select box. I found it in 2.1, and the site still works in 2.3.3, but I'm doing a second site, and I cannot find that item on the Write Page page.

  8. xercs
    Member
    Posted 4 years ago #

    FrankRichards, I am using 2.3.3 and I can see the write page option. Its actually a drop down option. I never used 2.1 so perhaps things have been moved around ?
    As for the link I think what I am after might be more along the lines of index.php?page_id=4
    The problem with this those is that comments are now also included on the page and I would like multiples posts accessible and not just the one.

    chazbeaners please can you clarify your recommendation, it seems to suggest that because I have a template called "about" a URL called "about" is now also accessible ?? Is this how wordpress works ??

    Cheers,
    Paul

  9. moshu
    Member
    Posted 4 years ago #

    xercs,

    do some reading:
    re: "about" > Using_Permalinks
    re: Page templates in Write Page subpanel - it displays ONLY if you have a "named" Page template (not if you have only the default page.php)
    re: posts on Pages. That's nonsense. Pages are Pages and posts are posts. Don't mix them!

  10. xercs
    Member
    Posted 4 years ago #

    Thanks, what I actually needed was a category template. I wanted to display a different view based on which category the pilgrim was browsing. I should have articulated myself better.
    For anyone interested:

    http://codex.wordpress.org/Category_Templates

Topic Closed

This topic has been closed to new replies.

About this Topic