CSS to show header only on few pages

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

Hi, this CSS show us how to exclude the header or footer in one or more pages…

my QUESTION …
how can I show the header in only few pages from appearing now in many… meaning, that instead of going to exclude 100 id,s… is there a CSS to say… show header only on page id 130 and 135 ?

You could hide all the site headers first, then display the few you want displayed. For example:

.site-header {
   display: none;
}
.page-id-120 .site-header,
.page-id-124 .site-header {
   display: block;
}
4 Likes
site-header, .site-footer {display: none;}

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

(Substitute whatever is appropriate for display: block.)

Or give those few pages a class so you don’t need to list them individually.

.newclass .site-header, .newclass .site-footer, {
display: block;
}

Edit:
Ninja’d!

1 Like

hey Thanks, looks easy,…

“display: block” means actually to display it?

well… its hidden everywhere… fine so far…

appearing in the specific id’s not working… sure i put in “block”

.site-header {
display: none;
}
.page-id-4 .site-header
.page-id-44 .site-header
.page-id-38 .site-header {
display: block;
}

that’s how i put in the CSS … but those 3 pages not showing, as the rest of them… any idea?

THATS WHAT A “,” CAN DO TO YOU !!! AHAHAHAHA

ok THANKS !!! working !!!

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.