Not including header.php
and footer.php
is a bad idea, as they usually contain the calls to wp_head()
and wp_footer()
, which are required by Plugins and Theme functionality (of course depending on what you do on your site).
The second thing is that you create invalid HTML.
Depending on your needs there are a variety of solutions for that.
If you just want to remove the styling, you could dequeue style.css
at the beginning of your template (before calling get_header()
):
wp_dequeue_style( 'style' ); // whatever slug you registered your style.css on
This way you do not deliver the style.css
.
But I do not think that this is what you want. If you want to remove the header and the footer of your template (for example the menu on top and the footer links), the best way would be to have a look at the functinon get_header( $name )
. As you can see, you can pass a string to it, and when you do, another php file is called.
get_header(); // results in header.php getting loaded
get_header( 'custom' ); // results in header-custom.php
It is the same thing with get_footer()
.
In your new header-custom.php
you can just add the little content that you need, to ensure a correct display and functionality of your site.
To wrap things up, When creating the page in WordPress, you need to select your new page template, and everything else works automatically.