-
AuthorPosts
-
September 28, 2020 at 11:51 am #1248961
Hi All,
I am trying to set up a page in which to insert code blocks for PC and iPhone / mobile. Respectively I inserted two blocks with the code for 3 columns on PC and 2 columns on iPhone setting where to hide/not consider this code.
What I get is that I always get 2 columns even on PC instead of 3 …
Where am I wrong if I’m wrong?September 29, 2020 at 6:33 am #1249259Hey amepro,
Please provide a link to the site/page in question so we can look into this issue further.
Best regards,
Jordan ShannonSeptember 29, 2020 at 10:34 am #1249306Hi Jordan, thi is the link
Page with problem
This page has been structured with two code blocks the first one for PC only and the second one for screens less than 479 pxThanks
October 1, 2020 at 7:03 am #1249817Hi,
Thanks for that. First off, could you try updating the theme to the latest version (4.7.6.3) to see if that helps please? https://kriesi.at/documentation/enfold/how-to-install-enfold-theme/#theme-update. If not then please post admin WordPress login details in private so that we can have a closer look.
Best regards,
RikardOctober 1, 2020 at 12:35 pm #1249863Hi,
I updated to Ver 4.7.6.3 but nothing has changed. Herewith I send info to access the backofficeThanks
October 3, 2020 at 5:44 am #1250247Hi,
Thanks for that. If you want some of your CSS to only apply to mobile then you will have to wrap it in a media query, like so:
@media only screen and (max-width: 767px) { .lcp_catlist { /*#lcp_instance_0*/ -webkit-column-count:2; -moz-column-count:2; column-count:2; /* il nr è la quantita delle colonne che vogliamo creare*/} }
Best regards,
RikardOctober 3, 2020 at 11:40 am #1250300Hi Rikard,
just to understand, so if I activate two sections of code on the page one for PC and one for mobile these are not read / do not work?
Also, since I have to handle exceptions, right at the page level, putting it in an external CSS file becomes problematic because I can’t define the variable with different names …
What do you advise me to do?October 4, 2020 at 12:30 pm #1250398Hi,
The options to show/hide elements will only affect the visibility, that means that if you add code to them then that code will apply anyway. If you want the code to only apply to some screen sizes then you will need a media query like in my example.
I’m not sure what you mean by exceptions though, could you try to explain that a bit further please?
Best regards,
RikardOctober 5, 2020 at 12:29 pm #1250577By exceptions I mean the various possibilities that I need depending on the length of the array / list that is generated and, I may need 1/2/3/4/5 columns to prevent the page from becoming very long. It is clear that on the mobile they must always be reduced to 1 or 2 columns for visibility reasons. Just a question: if in the code section I insert the <style> tag with its mediaquery inside it works or, should I use a text section?
Thank you and Best Regards
MaurizioOctober 6, 2020 at 8:49 am #1250758Hi Maurizio,
Thanks for the update. Your code should work in either the code block or text block element. You have the possibility to automatically insert the style tag in the code block though, so you might want to stick to that. If you want different codes for different screen widths then you can use different media queries, like this for example:
@media only screen and (min-width: 480px) and (max-width: 767px) { code goes here }
The above code will target medium to large mobile screens, and this will target all the sizes below that:
@media only screen and (max-width: 479px) { code goes here }
You could also simply add your CSS to Quick CSS, if you want the CSS to apply globally. Then you won’t have to add CSS on individual pages.
Best regards,
RikardOctober 6, 2020 at 10:03 am #1250784Hi Rikard
Thank you for allOctober 7, 2020 at 9:11 am #1251060 -
AuthorPosts
- You must be logged in to reply to this topic.