-
AuthorPosts
-
February 18, 2015 at 12:54 pm #209451
Hi,
A few weeks back, I found how to edit .php files to get the Ethos carousel to autoplay, but I can no longer locate said forum thread. I’m not sure if it was removed because the code is no longer effective, or if I’m simply having issues with forum search. I only come up with two KB articles on “Post IDs” and “demo content” when searching for “carousel”, “autoplay”, and “ethos”. Any idea how we would set our post carousel to autoplay?
February 18, 2015 at 7:09 pm #209726Hi there,
Thanks for writing in.
And I’m not sure what to look from search either. So I’ll just repeat it here and be sure you will bookmarked this too. ๐
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
1. Copy _post-carousel.php from /x/framework/views/ethos/ to /x-child-ethos/framework/views/ethos/
2. Edit your child theme’s _post-carousel.php and add these options :
autoplay: true, autoplaySpeed: 2000,
right before this :
speed : 500,
So it should be like this :
<script> jQuery(document).ready(function() { jQuery('.x-post-carousel').slick({ autoplay: true, autoplaySpeed: 2000, speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_extra_large', '5' ); ?>, slidesToScroll : 1, responsive : [ { breakpoint : 1500, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_large', '4' ); ?> } }, { breakpoint : 1200, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_medium', '3' ); ?> } }, { breakpoint : 979, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_small', '2' ); ?> } }, { breakpoint : 550, settings : { speed : 500, slide : 'li', slidesToShow : <?php echo x_get_option( 'x_ethos_post_carousel_display_count_extra_small', '1' ); ?> } } ] }); }); </script>
Hope this helps ๐
February 19, 2015 at 7:48 am #210069This worked exactly once, and stopped as soon as I shrank my browser window. Any known issues?? I’m not getting any hard conflicts. Cleared my cache, even tried turning off page compression…
February 19, 2015 at 8:01 am #210089OK, so at full-screen it begins to move again. At smaller sizes it does not. Could this be related to the carousel slides-per-screen setting? My settings in customizer:
Over 1500 pixels: 4
1200-1499 Pixels: 4
979-1199 Pixels: 3
550-978 Pixels: 2
Below 549 Pixels: 1Thanks
February 19, 2015 at 2:40 pm #210410Hi there,
I think it’s normal to the carousel library, where autoplay won’t be available on mobile size. And nothing we can’t do about it but request it as feature enhancement of existing library.
I checked the coding just to confirm it.
Thanks!
February 20, 2015 at 1:39 pm #211247Ah well, maybe one day in a future update. It’s not only “mobile”, but also when moving my browser window from literally the entire screen (27″ iMac) to 3/4 or less of the widescreen monitor. It does not work on mobile either though. Thanks for looking into it.
February 21, 2015 at 11:21 am #211830Youโre welcome.
-
AuthorPosts