Can't hide logo, tagline, and menu on specific page
-
Hi, first off, I want to say LayTheme is an amazing theme! I've used it multiple times and it's always been great. However, I’m having trouble hiding the logo, tagline, and menu on a specific page of my website. I’ve tried several solutions, but they’re still visible on the page.
What I've tried:
Used CSS and JavaScript to target the page by its slug (slug-info).Tried the following CSS:
body.slug-info .sitetitle,
body.slug-info .sitetagline,
body.slug-info nav.primary {
display: none !important;
}Also tried JavaScript:
<script>
document.addEventListener("DOMContentLoaded", function () {
if (document.body.classList.contains("slug-info")) {
const elementsToHide = [
document.querySelector(".sitetitle"),
document.querySelector(".sitetagline"),
document.querySelector("nav.primary")
];
elementsToHide.forEach(el => {
if (el) el.style.display = "none";
});
}
});
</script>Issue:
The elements still show up on the page. I’ve cleared my browser and site cache, but it’s not working.Any suggestions or help would be greatly appreciated!
Maggie
-
Hey Maggie, thanks a lot and sorry about the late reply. Could you insert a link here to the page where you want those things hidden?
Have you tried using your browser's inspector to look at the elements to see what could still make them remain visible?
-
Your CSS code seems to be correct, however, some malformed code before the CSS could make it not work properly. Or maybe the slug is incorrect. I would have to take a closer look, and actually need your website URL to see what happens here.
-
Hi Armin,
Thank you so much for your reply.
Here’s the link to my website (it’s still under construction):
https://gathereditions.com/info/I also tried using page-id-2020, but didn’t get any results either.
I’m not using any additional plugins, everything is up to date, and I’ve only designed a few pages — so I’m really not sure what could be causing the issue.
Thanks in advance!
Maggie -
In fact, I can’t hide the title, tagline, or menu on any page or project.
There must be something I’m missing.
Thanks again! -
Okay, so looking at that website, I can't see any custom CSS that you added to it.
For example, when I try to find:body.slug-info
It can't find anything.
In Chrome for example I can click on View - Developer - View Source
to see the source HTML code of your website which should contain the styles to hide your site title and more.Buuut as I said I don't see anything there. You don't by any chance have like a really aggressive caching plugin that you can disable?
-
Like this one, Lightspeed Cache. Please always check this blue box on the right that says "Before you post" and then first do the steps in there. Maybe this fixes the issue, but I'm not sure.
-
Hi Armin,
Thanks for your reply!
I've already deleted the LightSpeed Cache plugin.
The CSS lines are written under Lay Options > Custom CSS & HTML > Custom CSS, but it’s still not working.Let me know if there's anything else I should try.
-
can you send your website address, /wp-admin/ username and password and a link to this topic to info@laytheme.com?
-
Of course! I've just sent it.
-
all of your css is:
slug-info .laynav, slug-info .sitetitle, slug-info .sitetagline { display: none !important; } slug-urbana .sitetitle { display: none !important; }
however, thats invalid css.
it needs to be:.slug-info .laynav, .slug-info .sitetitle, .slug-info .sitetagline { display: none !important; } .slug-urbana .sitetitle { display: none !important; }
and
this was turned on: -
Seems like now, on the info page, things are hidden correctly: https://gathereditions.com/info/
-
Armin, thanks so much!
I must have written the CSS correctly the dozen times I checked it, but it turns out that checkbox was disabling it.
I knew it had to be something very simple that I just couldn't figure out—it's such a basic feature and I'm sure I've done it right before.
Thanks for being so attentive to all of us!
Maggie
I also code custom websites or custom Lay features.
💿 Email me here: 💿
info@laytheme.com
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