Support » Theme: Hueman » Slider post Random Selection

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi mmshahid73.

    1. Using your host file manager (cPanel) or FTP, create a /parts folder in your child theme.

    2. Copy the parent theme /parts/featured.php template file to the same folder in your child theme.

    3. At the top of the child theme featured.php file add the ‘orderby’ parameter to the query arguments:

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

    Reference: https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters

    Many Thanks 🙂

    You’re welcome.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Slider post Random Selection’ is closed to new replies.