• Hi, Is there a way to put only an x element from the category with random display? Say, like a preview – I’ll put 5 / total of 10 from x category.

Viewing 1 replies (of 1 total)
  • Thread Starter vonsch

    (@vonsch)

    Solved it. If you prefer to reach the same result, just add

    to include/hrf-faq.php

       $faq_params = shortcode_atts( array(
            'category' => '',
            'title' => '',
            'limit' => '',
            'random' => '',	   
        ), $attr );
    	$faq_args = array(
            	'post_type'      => 'hrf_faq',
            	'post_status'    => 'publish',
            	'posts_per_page' => empty($faq_params['limit']) ? -1 : $faq_params['limit'],
            	'orderby'        => filter_var($faq_params['random'], FILTER_VALIDATE_BOOLEAN) ? 'rand' : 'menu_order',
            	'order'          => 'ASC',
       		);

    Then you get 2 more parameters
    [hrf_faq limit=”5″ random=”yes”]

Viewing 1 replies (of 1 total)
  • The topic ‘random display / limit of elements?’ is closed to new replies.