Custom Lightbox Background for Each Project
-
Hello,
I hope you're well.
Please see the project link and code below. Would you let me know where I've gone wrong?
I was using some code to get a custom lightbox background colour on some projects. It stopped working and I can't figure out why.
When I browse the link I get the lightbox bg as set in the lightbox settings: #e5e5e5
I am trying to override it to #fafafahttp://sebastianpetrovski.com/lauren-trend-for-oyster-magazine
/* lightbox bg lauren trend for oyster*/ .type-project .id-356 .lightbox-bg { background-color: #fafafa !important; }
-
Dear @sebastianpetrov
body.lightbox-css-on #lightbox-region .lightbox-bg { background-color: red !important; opacity: 1; }
That does not work?
Best!
Marius
-
Hey Marius!
I think that would target all pages?
I tried the below - is there another way?
/* lightbox bg lauren trend for oyster*/ .type-project .id-356 body.lightbox-css-on #lightbox-region .lightbox-bg { background-color: #fafafa !important; }
-
Dear @sebastianpetrov
it's good to know that it in general works. Now you need to narrow it down.You need to add the class which limits it to the pages which you need.
Best!
Marius
-
sorry Marius - the code in general doesn't work and targeting a specific page doesn't work either.
Any ideas?
-
Dear @sebastianpetrov
it works.
I just tested again.slug-lauren-trend-for-oyster-magazine.lightbox-css-on #lightbox-region .lightbox-bg { background-color: red !important; opacity: 1; }
Best!
Marius
-
Hi Marius,
Thanks so much for your help - its not working for me - on multiple computers - and I am using incognito windows to prevent the browser loading from a cache of any sort.
Maybe something else is interfering?
Here is all the code in the custom css and html for desktop:
/* dummy */ /* site title */ body.slug-dummy .sitetitle.txt .sitetitle-txt-inner span{ display: none; } /* navigation info */ body.slug-info nav.primary a{ display: none; } /* navigation for info page */ body.slug-info nav.second_menu a{ display: none; } /* site title info */ body.slug-info .sitetitle.txt .sitetitle-txt-inner span{ display: none; /* s */ /* site title */ body.slug-s .sitetitle.txt .sitetitle-txt-inner span{ display: none; } .flickity-page-dots .dot { display: inline-block; width: 3px; height: 3px; margin: 1px; margin-top: 8px; margin-right: 8px; margin-bottom: 8px; margin-left: 8px; } div.instagram-button img{ height: 25px!important; } .instagram-button a:hover { opacity: .5!important; } /* lightbox bg out for duel magazine*/ .type-project.id-288 .lightbox-bg { background-color: #fafafa !important; opacity: 1; } /* lightbox bg televised for ones2watch*/ .type-project .id-299 .lightbox-bg { background-color: #fafafa !important; } /* lightbox bg lauren trend for oyster*/ .slug-lauren-trend-for-oyster-magazine.lightbox-css-on #lightbox-region .lightbox-bg { background-color: #fafafa !important; opacity: 1; } /* site title for project pages */ body.type-project .sitetitle.txt .sitetitle-txt-inner span{ display: none; } /* site title for projects page */ body.type-page .sitetitle.txt .sitetitle-txt-inner span{ display: none; } /* site title for projects page */ body.slug-landing .sitetitle.txt .sitetitle-txt-inner span{ display: none; } /* navigation landing */ body.slug-landing nav.primary a{ display: none !important; } /* navigation for landing page */ body.slug-landing nav.second_menu a{ display: none !important; }
-
Dear @sebastianpetrov
yes. Try to delete that code and only insert the one which I gave you.If it still does not work - let us know :-)
Best!
Marius -
Thank you so much for your help with everything site related - I'm so happy with how it is at the moment.
And guess what the problem was...
A missing "}"
-
Dear @sebastianpetrov
de nada. I am here to help.Yes. It is the details.
Sometimes it is good to copy the CUSTOM CODE into an editor to check the syntax.
Best!
Marius
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it