Site logo

Archived topic

Disable on blogpages

13 replies · Started by Matthias on January 2, 2019

Viewing posts 1–14 of 14

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?

Hmm the code should definitely work on those pages.

What do you mean it's disabled?

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 */
    }
}

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

This archived topic is closed to new replies.