• Resolved kappaluppa

    (@kappaluppa)


    Are templates for pages created the same using:
    <?php
    /*
    Template Name: harpcode
    */
    ?>
    at the top of the page?

    I am using 2.0 and for some reason my templates are not working.

    Thanks,
    K

Viewing 10 replies - 1 through 10 (of 10 total)
  • They should.
    What exactly do you mean they are not working?

    Thread Starter kappaluppa

    (@kappaluppa)

    I had used this:
    <?php
    /*
    Template Name: harpcode
    */
    ?>
    <? header (“Location:https://kelleyharp.com/&#8221;); ?>

    before and when you went to a page that used that template, it would redirect to another page. the redirect is not working now.

    The page name is kelleyharp.com. The blog url kelleyharp.com/lowry, so the page goes to kelleyharp.com/lowry/kellyharpcom rather than the url specified in the redirect.

    I’ve used, and am using the redirect like this in other blogs. I am wondering if something changed in 2.0 to make it not work anymore.

    thanks…
    k

    Thread Starter kappaluppa

    (@kappaluppa)

    Or…….
    Perhaps someone has a better way of redirecting pages…

    <? header ("Location:https://kelleyharp.com/"); ?>
    I never used that stuff… and haven’t even seen before.

    For redirecting Pages (but not templates) you can use the Redirectify plugin:
    https://redalt.com/downloads/

    moshu, I’m confused ~8-}

    kappaluppa says:

    “Are templates for pages created the same using:
    <?php
    /*
    Template Name: harpcode
    */
    ?>

    at the top of the page?”

    And your answer confuses me:

    “They should.”

    Why? The definition of the name of the theme is in the style.css file, and I have seen no theme with this PHP comment. Should there be such a comment really?

    The default Page template (which is page.php) doesn’t need that: WP knows how to recognize it if it exists.
    If you have more than 1 (=default) Page templates, then you need those lines at the top: this is how they will appear in the Write Page panel in the Page Template menu.
    see Pages#Page_Templates

    My “they should” was referring to “templates are not working”.

    P.S. the name of the theme is in the style.css file

    Yes, but we are talking about templates, and themes are a different story ??

    Thread Starter kappaluppa

    (@kappaluppa)

    This is not the name of theme, but of the template that is used for specific wp pages. Then I can have the formating of the content however I want it.

    The page still uses the css for the theme.

    Thanks guys! I’m not confused anymore.
    I haven’t got so far as to using different page templates, bu I’ll have good use of this, as I’m planning to!

    Thread Starter kappaluppa

    (@kappaluppa)

    I should remember my golden rule…
    “When in doubt, check the .htaccess file”

    So, that is what I did and it fixed it.

    I had had the site on a temp server and just transfered over the files to the new site. I forgot to re-structure the .htaccess file for the new site. I did it, and now it works.

    Thanks for your help!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘template name for WP 2.0’ is closed to new replies.