Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #736515

    Hi,

    I’m displaying posts on my site within a grid-layout. Now I want to show the posts at random. I’ve tried a lot of ways to achieve this, mentioned on this forum and other WordPress related forums.

    On the page, see private content for a link, I show the posts with a shortcode. This shortcode uses tags to know which posts to display. The plugin which makes this possible uses the default wordpress loop, if this isn’t overruled by Enfold. Don’t know how this works exactly.

    Could you help me out sorting the posts random?

    Regards,

    Erwin

    #738104

    Hi erwin_m!

    Thank you for using Enfold.

    Please add this filter in the functions.php file.

    function avia_post_slide_query_mod( $query, $params ) {
    	if( is_archive() ) {
    	    $query['orderby'] = 'rand';
    	}
        return $query;
    }
    add_filter('avia_post_slide_query', 'avia_post_slide_query_mod', 10, 2);

    Best regards,
    Ismael

    #738223

    Hi Ismael,

    This is working great. Thanks!

    Regards,

    Erwin

    #738242

    Hi!

    Happy we can help.
    Please feel free to create a new ticket if you need something else and please
    remember to also rate Enfold at themeforest, it really helps us out!

    Thanks a lot

    Cheers!
    Basilis

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Random posts in category page’ is closed to new replies.