Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi mzstade. Sorting the slider posts requires a modification to one of the theme files. If you don’t currently have a child theme I’d recommend you install one first. You can download one from within the theme (Theme Options, Help tab upper right). Then copy /inc/featured.php from the parent theme to /inc/featured.php in your child theme. In that file find this at the top:

    $featured = new WP_Query(
    	array(
    		'no_found_rows'			=> false,
    		'update_post_meta_cache'	=> false,
    		'update_post_term_cache'	=> false,
    		'ignore_sticky_posts'		=> 1,
    		'posts_per_page'		=> ot_get_option('featured-posts-count'),
    		'cat'				=> ot_get_option('featured-category')
    	)
    );

    Add the “order by” line:

    $featured = new WP_Query(
    	array(
    		'no_found_rows'			=> false,
    		'update_post_meta_cache'	=> false,
    		'update_post_term_cache'	=> false,
    		'ignore_sticky_posts'		=> 1,
    		'orderby'        		=> 'rand',
    		'posts_per_page'		=> ot_get_option('featured-posts-count'),
    		'cat'				=> ot_get_option('featured-category')
    	)
    );

    Here’s a Codex page reference to sorting posts in WP_Query.

    Thread Starter mzstade

    (@mzstade)

    Ok, that works fine. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Random for Flexsilder’ is closed to new replies.