Shuffle Slider post (random)

  • Anonymous

    #426

    Is it possible to implement a shuffle mode for the slider, where a random selection of post would be chosen? This way, users will see a different set of posts in the slider when the access the home page.

    Admin

    Syahir Hakim

    #12442

    Sounds like a good idea.

    I’ve implemented this and will be available in the next update.

    drchewbacca

    #12443

    Hello

    Is it possible to tweak this so that the random posts displayed in the slider are taken from only one given category.

    Example : I have a category named “Featured” where I store all the posts that I think most interesting for my readers. Comes a time when this category has many posts. The “random post from the “featured” category” slider would be a great way to keep these old posts alive, while keeping the rest of the blog’s contents “hidden” in the archives.

    Admin

    Syahir Hakim

    #12444

    Select the category you want to be shown in the slider, then add this in your child theme’s functions.php file:

    <?php
    function graphene_randomise_slider_posts( $args ){
    $args = array_merge( $args, array( 'orderby' => 'rand' ) );
    return $args;
    }
    add_filter( '', 'graphene_randomise_slider_posts' );
    ?>

    drchewbacca

    #12445

    Thank you for your reply.

    I didnt have a child theme until now, so I created one. I only made a style.css file (with nothing in it but the minimal content you have written in your sticky post about child theme for graphen) and a function.php with nothing else but the code you just told me to add.

    The child theme is working (I have to change the header image again and stuff), but the randomization of slider posts does not seem to be working: the posts are still showing from latest to oldest.

    Is there anything else I should do so that the functions.php file work?

    Here’s my site:

    http://www.geekdad.fr

    Admin

    Syahir Hakim

    #12446

    Oops..sorry, missed something in the code I provided. This one should work:

    <?php
    function graphene_randomise_slider_posts( $args ){
    $args = array_merge( $args, array( 'orderby' => 'rand' ) );
    return $args;
    }
    add_filter( 'graphene_slider_args', 'graphene_randomise_slider_posts' );
    ?>

    drchewbacca

    #12447

    This is working like a charm. Thanks a lot, you rock!

    Mod

    Kenneth John Odle

    #12448

    What a cool feature! Wish I’d thought of it, but I’m glad somebody did. Thanks!

    Rife

    #12450

    Useful thing this Slider is.

    But what I’d like to see is an option to exclude one or more categories. On the other way round could you make it possible toselect multiple categories from the drop down list? And not only one. It’d be great.

    Thanks.

    Admin

    Syahir Hakim

    #12451

    Version 1.5 will allow you to select multiple categories for the slider.

Viewing 10 posts - 1 through 10 (of 12 total)

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!