Support » How-To and Troubleshooting » [Resolved] Rotate or Shuffle My Posts

[Resolved] Rotate or Shuffle My Posts

  • I have a site with my art portfolio. Each piece is a photo with a description. I would like to randomly have an older post come up to the first place on the home page. Is there a way to do this manually or with a plugin?

    The plugin “rotating posts” is not what I want it to do but it looks like a great plugin anyway.

Viewing 3 replies - 1 through 3 (of 3 total)
  • This will retrieve and display one random post.

      'orderby' => 'rand',
      'post_type' => 'post',
      'post_status' => 'publish',
      'posts_per_page' => 1,
      'caller_get_posts'=> 1
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
      echo 'List of Posts';
      while ($my_query->have_posts()) : $my_query->the_post(); ?>
        <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
    wp_reset_query();  // Restore global post data stomped by the_post().

    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

    Thanks for the help Michael.



    My question is the same as shawngoesgreen however I do not know what to do with the Script that MichaelH has provided. I am a Newbee to WordPress so I am sure this question will seem to be easy to most. Any help would be greatly appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Rotate or Shuffle My Posts’ is closed to new replies.
Skip to toolbar