• Hi, I’m having an issue pulling a random testimonial post in my theme — I’ve tried this exactly as the codex says and no luck. Anyone see something I’m doing wrong? BTW, this is on an older install, 3.1 — not sure if that makes a difference.

    <div id="quote-box">
         <?php $da_featured = new WP_Query( array ( 'orderby' => 'rand', 'posts_per_page' => '1', cat => '7' ) ); ?>
         <?php while ( $da_featured->have_posts() ) : $da_featured->the_post(); ?>
              <p>
    	      <?php the_content(); ?>
              </p>
    	  <em>
                   -<?php the_title(); ?>
              </em>
         <?php endwhile; ?>
    </div>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Random posts not working — followed it to the letter from Codex’ is closed to new replies.