i wondering how can i remove header and footer from the one particular post. i have searched around google and wordpress but i didn’t get anything which can prevent header and footer to display.
i am using memberpress plugin and i am changing the design of registration form. here i am not able to use custom template also.
i know for page we can prevent to display some of the code for that page by using following code but need help on post.
if(!is_page('1'))
//not to display
any help?
You can use is_single function just like is_page.
http://codex.wordpress.org/Function_Reference/is_single
Copied from Codex:
There are two ways..
(1)create php file as ‘single-PID.php’ in your selected theme folder
suppose that you added post and the post id is 18(remember post id is important) and on that you don’t want header and footer. so
get_header()
andget_footer()
.now add below function in ‘function.php’ file :
admin side ,select posts from menu …click view on post that has id ’18’
(2)create php file as ‘page-PID.php’ in your selected theme folder
suppose that you added page and the page(save as post type ‘page’ in wp-post database table) id is 8(remember post id is important) and on that you don’t want header and footer. so
get_header()
andget_footer()
.