- This topic has 14 replies, 3 voices, and was last updated 5 months ago by
Ying.
-
AuthorPosts
-
October 25, 2022 at 7:58 am #2385671
Chaz
Hi,
I tried to follow a few posts on the topic of this forum. I created a hook element to generate_after_footer, then I tried to add the following CSS, but it doesn’t work:
.custom-ad-container { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: fit-content; height: fit-content; }
Any idea where I’m going wrong?
October 25, 2022 at 8:20 am #2385698David
StaffCustomer SupportHi there,
try clearing any plugin and browser caches,
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 25, 2022 at 8:38 am #2385721Chaz
Hi David, I did try that. Still not working. See screenshot: https://prnt.sc/RX5cUuRxo2UX
October 25, 2022 at 8:42 am #2385725David
StaffCustomer SupportWhere did you add the CSS ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 25, 2022 at 9:03 am #2385753Chaz
In the Additional CSS within the Customize section here: https://prnt.sc/Bc1No-tf1LeX
October 25, 2022 at 9:22 am #2385782David
StaffCustomer SupportRe-add the CSS to your site.
And then disable WP Rocket so we can take a closer lookDocumentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 25, 2022 at 9:27 am #2385790Chaz
Ok, WP rocket switched to safe mode. Can you take a closer look?
October 25, 2022 at 9:31 am #2385796David
StaffCustomer SupportI can see the CSS is there and working:
So looks like WP Rocket was messing with it. Try re-enabling it.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 25, 2022 at 9:36 am #2385803Chaz
I’m not seeing the sticky banner ad. I’m trying to replicate this: https://prnt.sc/yON5xwKrKa4l
October 25, 2022 at 9:38 am #2385810David
StaffCustomer SupportTheres a chance that the container is collapsing and the advert script inside it is not calculating the size.
Change your CSS to:.custom-ad-container { position: fixed; bottom: 0; left: 0; width: 100%; min-height: 100px; background-color: #000; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 25, 2022 at 10:14 am #2385881Chaz
It was working but the alignment was not centered and the ad was too big. So I swapped the ad unit to something a bit smaller, but it still not sticky
October 25, 2022 at 12:23 pm #2386116Ying
StaffCustomer SupportHi there,
Are we talking about this ads?
https://www.screencast.com/t/Mxz7QIarIf so, I don’t see a class
custom-ad-container
being added to it, so the CSS David provided here https://generatepress.com/forums/topic/how-to-create-a-sticky-responsive-ad-on-the-bottom-of-screen/#post-2385810 is not going to work, because it’s not targeting anything.October 25, 2022 at 12:48 pm #2386154Chaz
Hi Ying, that is the ad I am trying to make sticky. So how do I get it to work?
October 25, 2022 at 1:28 pm #2386223Chaz
Ok, so I think I fixed it by adding the following tag within the hook element before the ad script.
<div align="center" class="custom-ad-container">
I then updated the additional CSS as follows
.custom-ad-container { position: fixed; bottom: 0; left: 0; width: 100%; min-height: auto; background-color: #232324;opacity:0.95; }
Seems to be working now. See screenshot: https://prnt.sc/zADWB0FAqiLo
October 25, 2022 at 2:28 pm #2386321Ying
StaffCustomer SupportI just checked, it’s working now 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.