• Resolved thebindlestick

    (@thebindlestick)


    So I copied my page.php fil and renamed it custserv.php, and added the theme name to the top of the code like described in the wordpress docs. So where do I save custserv.php to on my server? Inside my theme folder (I am using Dark Ritual)? or do I make a new folder for this theme by itself? I went into the specific page I want to affect and selected the new theme name (it showed up when the file was inside my Dark Ritual folder) but when i go to the page I get this error:

    Fatal error: Call to undefined function: get_header() in /hermes/web01/b1365/pow.crawlmag/htdocs/wordpress/wp-content/themes/darkritual/page.php on line 1

    Ideas?

Viewing 7 replies - 1 through 7 (of 7 total)
  • For a Page template you don’t add the theme name – you add what is described here:
    http://codex.wordpress.org/Pages#Creating_your_own_Page_Templates
    and you put it in the theme folder.

    Thread Starter thebindlestick

    (@thebindlestick)

    which theme folder? I am using Dark Ritual, so I put the new page template in that folder? I did that and it errors out when it tries to load the header include.

    Thread Starter thebindlestick

    (@thebindlestick)

    Rudolf, here is what I did:

    opened DarkRitual/page.php and resaved it as custserv.php in the same folder. This is going to be my customer service page with a contact us form. I added:

    <?php
    /*
    Template Name: CustSevTemplate
    */
    ?>

    to the top of the file and resaved it to the DarkRitual folder. I then opened up my manage-> pages -> customer service page and changed the theme to CustServTemplate, saved it and went back to my index. When i click that page, I get the error where it cannot load the header. What am i doing wrong?

    (just for the record: theme and template are not interchangeable words in WP)

    According to your description you did the right thing.

    Thread Starter thebindlestick

    (@thebindlestick)

    Okay, this does not work. If I create a copy of my page or index file (renaming it) and use it as a Page Template, it cannot load the header file, and assuming it would error out at any other include when it got to them. Here is what I need to do, is there a better way to do it?

    Look here: http://www.crawlmag.com/wordpress

    The green links on the left need to go to Pages, i.e. “contact us” – “customer service” – “subscribe” and other static content pages. Obviously to subscribe you need to fill in a form, same with a contact form, so I need to basically create a page that looks like the rest of my Theme, but allows me to run code inside the body. You cannot do that in Pages w/o installing plugins. So, what is the best way to create pages that look just like my main Theme pages, what files do I need to copy/rename?

    and why are my page.php and index.php files inside my Theme exactly the same code?

    Thread Starter thebindlestick

    (@thebindlestick)

    Rudolf said: “or a Page template you don’t add the theme name – you add what is described here:
    http://codex.wordpress.org/Pages#Creating_your_own_Page_Templates
    and you put it in the theme folder.”

    But that page says this:

    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
    */
    ?>

    so you do have to ad the name, how else would you select it?

    Thread Starter thebindlestick

    (@thebindlestick)

    Got it figured out.

    Now I’m having DIV tag issues 🙂

    lovely day.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Custom Page Theme file location’ is closed to new replies.