kevin123williams123 on "How Do I Remove the Header and Footer for A Single Page"

ساخت وبلاگ

Each page will have a unique ID associated with it. Do a view source on the page that you are interested in, and look for the body tag (it will start with the string <body). You will see a class name associated with the body tag that looks like page-id-###, where ### is the page/post ID that is unique to that page. For example, if you were to do a view source on your Services page, you should see a class called page-id-154 in the body tag. So you can use that class name to target elements on just that page.

You don't want to make changes to any of the theme's files because your changes will be lost the next time you update/upgrade the theme. Instead, if you want to make CSS changes without having to create a child theme, then first install a CSS plugin like Jetpack or Custom CSS Manager. So let's say you want to hide the header & footer on the Services page. You would then add a rule that looks like this:

.page-id-154 .site-header,
.page-id-154 .site-footer { display: none;
}

There are two selectors in this rule, one for the header and one for the footer. The class name for the page ID was added to the beginning of each selector to limit the scope of the rule to that page. Note the period that's placed before the class name.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 200 تاريخ : پنجشنبه 3 تير 1395 ساعت: 13:43