BellaCole Posted August 11, 2023 Posted August 11, 2023 Hi, Thanks in advance for your help. I have custom code injected on my site so that the header for each site page is different on desktop and mobile. The problem is that I would like to start posting blog content, and the code I used is making it so that the blog post content isn't visible on mobile devices. The site url is https://poze.app The code I used is: <style> @media only screen and (max-width: 780px) { #page section:nth-of-type(1) { display: none; } } @media only screen and (min-width: 781px) { #page section:nth-of-type(2) { display: none !important; } } @media only screen and (min-width: 781px) { #page section:nth-of-type(3) { display: none !important; } } Is it possible to exempt all blog post pages from this code injection? Thanks.
Solution Lesum Posted August 12, 2023 Solution Posted August 12, 2023 (edited) Hi, first remove "!important" from your code in custom css. Then after going to blog > advanced > page Header Code Injection, you can insert this code: <style> @media only screen and (max-width: 780px) { #page section:nth-of-type(1) { display: block !important; } } @media only screen and (min-width: 781px) { #page section:nth-of-type(2) { display: block !important; } } @media only screen and (min-width: 781px) { #page section:nth-of-type(3) { display: block !important; } } </style> It should exclude the custom css from blog posts. Edited August 12, 2023 by Lesum BellaCole 1 If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. Sam Web Developer & Digital Designer ☕ Did you find my contribution helpful? Buy me a coffee?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment