Tagged: columns, post slider
-
AuthorPosts
-
October 28, 2016 at 8:07 am #705182
Thank you for your time.
I’m not sure how else to describe this, but this is what I’m trying to do:
I have the post slider set to 4 columns on the desktop. I would like to be able to reduce the number of columns as the screen size shrinks so that the slider remains horizontal and does not go vertical. This would probably mean three at the tablet range and two for smart phones.
I have an established child theme and a bit of css code to modify three things: meta information, socket position, and main menu font size (which is on the left).
Thank you in advance.
October 28, 2016 at 5:24 pm #705362Hope to hear from you soon. Thank you for all that you do.
October 28, 2016 at 6:32 pm #705379Hey!
You can control the size of the columns, with Media Queries
Please do let us know if we can do anything else for you
Cheers!
BasilisOctober 28, 2016 at 6:37 pm #705382Thank you for your reply. This looks doable.
However, what is the css code which controls the number of columns or the particular size? I’ll admit that this is a learning process.
October 28, 2016 at 7:26 pm #705394Ok, so what I think needs to be adapted is the avia-content-slider so that in each section it would change from av_one_half at the smallest, then av_one_third next up and so forth with av_one_fourth and av_one_fifth.
Using the Media Queries you gave me, what would the code look like? I understand the min-width and max-width concept here, just not how to structure it after that point.
Thank you in advance.
November 1, 2016 at 2:53 pm #706733Hi,
Would you mind providing a precise link to your site, showing the elements in question? We need to be able to inspect them in order to help :)
Best regards,
AndyJanuary 5, 2023 at 9:22 am #1377678Hello. Did you find a solution? Thanks!
January 5, 2023 at 4:48 pm #1377717The problem with this is that enfold groups the articles according to this column setting – meaning 3 columns will result in 3 articles in a slide-entry-wrap.
Maybe the developers could think about this behavior – because it hinders exactly this layout possibility you want to achieve.The grouping then had to be done by flex layout
we can have a script to reach that layout – but better would be to get it on DOM generation.
( this is now only done here in my example snippet for one page ( my blog page only ID: 36400 )
function wrap_articles_in_one_flex_container(){ if(is_page(36400)){ ?> <script type="text/javascript"> window.addEventListener("DOMContentLoaded", function () { (function($) { $('.avia-content-slider-inner .slide-entry-wrap .slide-entry').each( function() { $(this).detach().appendTo('.avia-content-slider-inner .slide-entry-wrap:first'); }); $('.avia-content-slider-inner .slide-entry-wrap:empty').remove(); })(jQuery); }); </script> <?php } } add_action('wp_footer', 'wrap_articles_in_one_flex_container');
and for css:
#top.page-id-36400 .avia-content-slider .slide-entry-wrap { display: flex; flex-flow: row wrap; justify-content: center; } #top.page-id-36400 .avia-content-slider .slide-entry-wrap .slide-entry { flex: 0 1 calc(25% - 30px); margin: 0 15px 30px; width: unset !important; } @media only screen and (max-width:1310px) { #top.page-id-36400 .avia-content-slider .slide-entry-wrap .slide-entry { flex: 0 1 calc(33% - 30px); margin: 0 15px 30px; } } @media only screen and (max-width:989px) { #top.page-id-36400 .avia-content-slider .slide-entry-wrap .slide-entry { flex: 0 1 calc(50% - 30px); margin: 0 15px 30px; } } @media only screen and (max-width:767px) { #top.page-id-36400 .avia-content-slider .slide-entry-wrap .slide-entry { flex: 0 1 100%; margin-bottom: 30px !important; } }
adopt to your blog ID
see here: https://webers-testseite.de/blog/January 5, 2023 at 5:05 pm #1377719EDIT: sorry i did not read carefully: – you have a content-slider !
just a moment …this will be not as easy possible because the slide elments are those wrappers ( slide-entry-wrap ) – the count of articles are based on that column setting.
A quick and dirty way ( duplicate content) for the 3 column layout would be to place a copy of your content-slider and set it for the screen-width dependency to display : none/block
on that page you can see the setting – shrink screen width to see the 3 column layout and setting.
-
AuthorPosts
- You must be logged in to reply to this topic.