Hi guys,
I’m trying to assemble a simple carousel for my portfolio items.
Instead of having the regular grid, this:
Ex: From a universe of 200 portfolio items, display 6 random items side-by-side and a next/prev button that will show 6 more. That’s it, 6 + 6.
What I tried to do was having the portfolio grid display 12 random items and then apply an external JS plugin to turn the wrapper div into a carousel/slider.
It didn’t work as expected and the results were too irregular. Meaning, sometimes the entries just don’t show up, and when they do, the slider stops working after pressing the next/prev button 1 or 2 times.
My questions: Is there an easy way of doing this with Enfold only? If not, is my idea possible and can I get some help from you guys?
Thanks a lot in advance
Just noticed I could almost use the Post Slider element for this, except it has no “Order by” option, so I can’t make it random.
That would work perfectly as well…
Hi!
Change lines 507 – 508 in the /enfold/config-templatebuilder/avia-shortcodes/postslider.php file from this.
$query = array( 'orderby' => 'date',
'order' => 'DESC',
To this.
$query = array( 'orderby' => 'rand',
'order' => 'DESC',
If your using a child theme then you can copy lines 216 – 543 to your child theme functions.php file and change it there so it’s saved between updates.
Regards,
Elliott
Well that crashed my site :D
But I did try to copy lines 216 – 545 (to grab that couple last closing braces) and it worked!
I found out about editing postslider.php but I didn’t know about the child theme part, so that was perfect.
Thank you very much!
Hey!
glad Elliott could help. Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.
Best regards,
Andy