• Please Help I have some question, I tried to create Random Post on Search Page. I was tried to displayed 5 random post only. But when I check it on my search page. The Result displayed more than 30 post

    <div>
    <?php
          $random_query = new WP_Query(array(
          'post__not_in' => $do_not_duplicate,
          'showposts' => 5,
          'orderby' => 'rand'
          ));
          while ($random_query->have_posts()) : $random_query->the_post(); ?>
    <a href="<?php the_permalink() ?>"><?php the_title();?></a>
        <?php endwhile; ?>
    </div>

    How To fix it?

    Best Regards

    Jauhari

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Random Post on Search Page’ is closed to new replies.