• I read few posts but not working for me

    When i click on category i would like to see posts in random order not from latest post to first post.

    I don’t want random post i want random order

    If you’ll send me some code please let me know where i have to add this code

    Thanks for any help

Viewing 4 replies - 1 through 4 (of 4 total)
  • Can any one elaborate on this? i.e. put in simple terms for a non programmer? I would like to randomize the post on the homepage is there any easy way of doing this?

    Thread Starter ksgboy2

    (@ksgboy2)

    I’m using this

    <?php
    $args = array( 'orderby' => 'rand' );
    $lastposts = get_posts( $args );
    foreach($lastposts as $post) : setup_postdata($post); ?>
    	<h2><a>"><?php the_title(); ?></a></h2>
    	<?php the_content(); ?>
    <?php endforeach; ?>

    [Please post code or markup snippets between backticks or use the code button.]

    And on Home page everything is ok

    But on categories showing posts in random order but not from current category but from all posts

    Where do you put that above code? I have a very simple site up with only 10 posts. I would like the 10 posts to always be random.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show posts in random order’ is closed to new replies.