• 5794871

    Is it do-able? Basically, I made a form using simple HTML in a WordPress page, but the script that runs the form is a separate PHP file and I want the WordPress theme to apply to that file when displayed (which it won’t if it’s not in the database).

    Probably sounds confusing… Don’t hesitate to tell me if you don’t get it lol.

Viewing 15 replies - 1 through 15 (of 15 total)
  • davidandre

    (@davidandre)

    hi,
    why don t you paste the code of form directly in the template of your need, page.php ….in a div for example. it should work

    Thread Starter 5794871

    doesnt work

    esmi

    (@esmi)

    Why doesn’t it work? I think we need a bit more info on how this all fits together.

    Thread Starter 5794871

    If I create a new page and put hte code in “div” you’ll see the code on the page…

    esmi

    (@esmi)

    You need to put the code in a custom page template then create a new page and apply the new template.

    Thread Starter 5794871

    Is there an English version of what you just said or what that link says?

    esmi

    (@esmi)

    That was the English version. Or about as English as you’ll be able to find. ??

    It’s not that difficult to create a custom page template. Just copy page.php, give the new file a different name (eg: mytemplate.php), add the template comment block – with the template’s proper name – at the top and you’re away. If the new template shows up in the Template dropdown box when you go to create a new page, you know you’ve successfully created a new page template.

    At that point, you can start adding your own code to the custom template.

    Thread Starter 5794871

    Ah thank you. Much better ??

    Thread Starter 5794871

    OK so I copied page.php and renamed it. I erased the second part of it below the “************” and replaced it with my code. When editing a theme, it shows up as a page. Now what?

    esmi

    (@esmi)

    Create a new page, apply the new template to it and preview it.

    Thread Starter 5794871

    How do you apply the template to the new page?

    esmi

    (@esmi)

    Use the Template dropdown box on Edit Page.

    Thread Starter 5794871

    I don’t know where you see the template drop downbox because I looked everywhere and can’t find it.

    Thread Starter 5794871

    Never mind found it.

    Thread Starter 5794871

    Never mind I got it to work but it’s not really what I wanted to do. The page shows up blank. I wanted the page to KEEP the wordpress theme but contain PHP code.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Adding a .php page to database’ is closed to new replies.