WordPress.org

Ready to get started?Download WordPress

Forums

help me radomize the post (6 posts)

  1. betzy
    Member
    Posted 1 year ago #

    <?php
    	$counter = 0; $counter2 = 0;
    	while (have_posts()) : the_post();
    	?>
    <?php $counter++; $counter2++; ?>
            <div class="grid_6 <?php if ($counter == 1) { echo 'alpha'; } else { echo 'omega'; $counter = 0; } ?>">

    hello guys, can u pls help me
    the code above is in my index.php and i want to display random posts
    can someone help me ?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

  3. betzy
    Member
    Posted 1 year ago #

    i know how to google but i don”t know php :(

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    I'm sorry but if you cannot manage this yourself, then perhaps you need to consider hiring someone to carry out the work for you.

  5. betzy
    Member
    Posted 1 year ago #

    ok, 10q for your time

  6. betzy
    Member
    Posted 12 months ago #

    if anyone else want to do it, here it is
    /wp-content/themes/snapshot/index.php -- line 21

    $args = array( 'orderby' => 'rand' );
    				global $wp_query;
    				$wp_query = new WP_Query( $args );

    may the force be with you

Topic Closed

This topic has been closed to new replies.

About this Topic