« How To Find Which Shell Is Mapped To The Terminal In Mac Or Linux | How To Change Search Engine To Google From Bing In Microsoft Edge Browser »
How To Create A Blank Page Template In WordPress
Follow the below steps to create a new blank page template in WordPress. This would help to create pages without any extra header or body content.
Steps To Create a Blank Page Template
- Inside your custom theme, create a folder called “
templates
“ - Create a file named “tpl-blank.php”
- Copy paste the below code to that file
- Save the file and now you would be able to create a page with “
Blank Template
“
<?php /* Template Name: Blank Template */?>
<?php
if (have_posts()) {
while (have_posts()): the_post();
echo strip_tags(get_the_content(), '<p> <a>');
endwhile;
}
?>
Key Points on Code Snippet
- The value assigned to the key “
Template Name
” in the first line (to be commented) would be considered as the display name of template. strip_tags
function is required to remove the paragraph “<p>
” tags that are rendered by default by editor of WordPress
Leave a comment