• charlie67p

    (@charlie67p)


    Hi,

    On my Homepage there is a CBB carousel “partners” with 10 items.

    Once per month the order of the items should change. (so that in the end of the year each item/partner has been in the First position at least during 1 month)

    Is it possible to programmatically change Carousel Items order?

    Do you have any idea about how to achieve that ?

    An other way would be to randomize the items order every time the page is loaded. (but maybe it is a bad idea for the performances… and not sure that it would work with a cache/CDN…)

    Thank you



    • This topic was modified 9 months ago by charlie67p.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Phi Phan

    (@mr2p)

    Hi Charlie,

    Yes, there are some ways to achieve your requirement.

    The easiest way is, as you mentioned, using random order for the query. If your site doesn’t have thousands of posts, then performance is not an issue. For caching/CDN, you can set the expiry time to around 1 or 2 weeks.

    Another approach is to use a custom field like ACF Relationship field to store carousel posts. Then you can query posts from that custom field. You can manually change the order of the posts or create a cron job to do it automatically.

    To query the posts, you can use a similar code snippet from your old thread https://www.ads-software.com/support/topic/get-current-post-id-and-use-it-in-meta-query-builder/.

    Alternatively, my other plugin MFB Pro can query posts from a custom field. I recorded a video guide for it here.

    Phi.

    Thread Starter charlie67p

    (@charlie67p)

    Hi!

    Thanks you for your suggestions ! (Sorry that I did not answer earlier)

    I will try it as soon as I can

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Programmatically change Carousel Items order’ is closed to new replies.