wordpressTech

How to to hide Header and Footer on certain pages in WordPress

1. Find Your WordPress Page ID and Post ID without a Plugin

Finding your WordPress page ID or post ID is an extremely quick process. To find a page ID, open your WordPress dashboard and click on Pages > All Pages.

Open All Pages

Then, select the page that you need to find the ID for. Here, I have chosen my Contact page:

Contact Page

Once the page has opened, you need to look at the URL in your web browser’s address bar. Here, you will find the page ID number displayed within the page URL.

WordPress Page ID

To find out a WordPress post ID, follow the same procedure. Log into your WordPress dashboard, then select Posts > All Posts.

Posts All Posts

Click on a specific post that you need the ID for. Once you are in the post Editor, view the post’s URL in your web browser’s address bar to find the ID number.

Post ID

Add This piece of code in your themes functions.php

 

.page-id-“your page id” #header, .page-id-“your page id” #footer {

display: none; }

If you want to apply this code to a different page, you have to replace the “your page id” with the ID of the specific post or page you want to remove the header and footer from.

Related Articles

Back to top button