• yamword

    (@yamword)


    Newbie Here,

    Does anyone know if WP will accept a html template for a page and, if so, is there is a plugin for creating one.

    Created a php based template for our pages and it works fine but would like to create a html only template without the <php……, but instead
    using <!DOCTYPE……….

    Appreciate any help. Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Well… sort of.

    You can create a page, and other than the required <?php /* Template Name: Whatever */ ?>, you don’t have to include any PHP. Technically it would be a php file and would have to be named htmlonly.php or something but I think that would work. I haven’t tested it though.

    However, I’m not sure there is a good reason to try to incorporate this into WordPress at all. You can just create htmlonly.html, save it somewhere the server can find it, and create a link to it, so long as you don’t have naming conflicts.

    Thread Starter yamword

    (@yamword)

    That was quick, thank you.

    The php template for our pages works fine with only the content (from the editor) showing on the page. That is what we want.

    What I am seeking is when creating a page and selecting the template, I want that template to be only html with <!DOCTYPE….. not the <?php……!

    What I am seeking is when creating a page and selecting the template, I want that template to be only html with <!DOCTYPE….. not the <?php……!

    Right. I think, though I haven’t tested it, that what I suggested will do just that, except for the ‘Template Name’ part. Without that WordPress will not recognize it as a template file. That PHP comment is what WordPress uses to identify the templates. Without it, you can’t assign a file as a template. That is why I said ‘sort of’. Include that part at the top, and nothing else, and then you can write pure HTML for the rest of the file. I think that is as close as you can get from within WordPress. In other words, as far as know, you can’t do exactly what you are trying to do, but I think you can get very close.

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

The topic ‘HTML Template for Pages’ is closed to new replies.