Archived topic
Disable on blogpages
13 replies · Started by Matthias on January 2, 2019
Hi im using the divi builder on my normal pages and GP for my blog pages. how can I disable this code on my blog pages:
/* ** footer on scroll** */
@media (min-width: 1000px) {
.site-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
}
#page {
margin-bottom: 700px; /* adjust to the height of the footer */
}
}
The code its currently disabled, because it wont appair the right way on my blog pages.
Hi there,
So exclude the code on blog page?
If so try this:
@media (min-width: 1000px) {
body:not(.blog) .site-footer, body:not(.archive) .site-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
}
body:not(.blog) #page, body:not(.archive) #page {
margin-bottom: 700px; /* adjust to the height of the footer */
}
}
More info here: https://www.w3schools.com/cssref/sel_not.asp
thx, but that doesnt seem to work
Can you guide me to the page you are referring to?
https://www.insoon.nl/category/webdesign/ and https://www.insoon.nl/3-meest-voorkomende-wordpress-errors/ for example. All category and blog pages. At the moment the code is disabled
Hmm the code should definitely work on those pages.
What do you mean it's disabled?
Yes it works on these page but not the right way. . You can check the page links https://www.insoon.nl/de-5-voordelen-van-google-adwords-voor-jouw-bedrijf/ for example. I prefer to have this code removed from the blog pages, but the code doesnt seem to work the right way
Ahh so you are referring to single posts?
If so try this:
@media (min-width: 1000px) {
body:not(.single) .site-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
}
body:not(.single) #page {
margin-bottom: 700px; /* adjust to the height of the footer */
}
}
thx, but that does the trick for the single blog post. But can I also disable on the post category pages: https://www.insoon.nl/category/webdesign/ for example. And is it possible to disable the code on this page only : https://www.insoon.nl/blog
This should've worked for the post category page:
https://generatepress.com/forums/topic/disable-on-blogpages/#post-771277
As for https://www.insoon.nl/blog, you will have to add one more line to exclude it using body:not(.page-id-xx)
Please keep in mind that this is a support forum for GP questions and not general CSS questions.
Thanks!
Iam sorry, I think I got it now. Thx for all the help, rly appreciate it
No problem :)
This the correct code btw for the css: body:not(.blog):not(.archive):not(.single)
the above doesnt work with body:not(.blog), body:not(.archive) etc (this only works for jQuery)
Sometimes it might be easier to just target the condition you are after instead of doing :not