(urgent) Mobile: hide site title on every news page
-
Hello,
I wonder how it is possible in the mobile version (CSS) to hide the page title on each individual news page automatically (but not on the general news page).
Example:
www.test.de/news/news1
www.test.de/news/news2
www.test.de/news/news3
In this case I would want to hide it on news1, news2 and news3 (= automatically on everything that comes after "www.test.de/news/")On the contact page I hide the page title as well and solved it this way:
body.slug-contact .mobile-title,
body.slug-contact .navbar,
body.slug-contact .burger {
display: none !important;
}
body.slug-contact{
padding-top: 0;
}… but I don’t know how to address "everything that comes after "www.test.de/news/" in CSS.
I would be so happy if somebody knew!
Thanks in advance!
Fiona -
@fiona_oehler hey Fiona, you need to use the permalink of your news post so for example if your news post is:
www.test.de/news/my-news-article
the code will need to be:
body.slug-my-news-article .mobile-title,
body.slug-my-news-article .navbar,
body.slug-my-news-article .burger {
display: none !important;
}
body.slug-my-news-article{
padding-top: 0;
}Hope that helps :)
-
@alasdair17 Thanks so much for your help!
The only problem in this case would be that I (or my client) would have to make CSS changes for every single added news article, right? So I'm wondering if it's possible to set this to work automatically for all news-posts as well.
Best
Fiona -
@fiona_oehler you're welcome :)
Yeah I see what you mean, I'm not sure about it being done automatically at the moment, perhaps it's possible via javascript but that's a bit advanced for me!
If you pasted out a few copies of this code in the CSS panel and gave instructions to your client I'm sure they wouldn't mind as all they need to do is change the title in the code.
-
do this instead:
body.type-lay_news .mobile-title,
body.type-lay_news .navbar,
body.type-lay_news .burger {
display: none !important;
}
body.type-lay_news{
padding-top: 0;
}
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