• Hi everyone,
    I am facing a problem. I want to show custom post type randomly in my page. For example, I have 10 posts. but I want to show 5 post in page which will change randomly.

    How can I do this? Experts please help me.

    Regards.

Viewing 1 replies (of 1 total)
  • You need to build your args when calling $WPDB something like this..

    
    $args = array( 
      'post_type' => 'custom_yootunes', 
      'posts_per_page' => 5,
      'orderby' => 'rand'
    );
    
Viewing 1 replies (of 1 total)
  • The topic ‘Show custom post type randomly in any page.’ is closed to new replies.