Give help. Get help.

  • # March 20, 2013 at 6:08 am


    I really like Chris’ post about a “[Randomized grid of Posts]( “Randomized grid of posts”)”

    I don’t know php that well, so I would like to hear if you could help with the following:
    In Chris’ post he writes the following for handling the content:

    ” class=”box col< ?php echo rand(2,4); ?>“>
    < ?php the_title(); ?>
    < ?php the_excerpt(); ?>

    As I understand it this part: < ?php echo rand(2,4); ?>, is what “randomizes” the grid by choosing a random number between 2,3 and 4 for each box.

    I would very much like to do the opposite, but I don’t know the command in php. I would like to get a ordered sequence of boxes: 1,2,3,1,2,3,1,2,3 etc.
    Is it possible to change the “echo rand” command so it does the opposite?

    Hope you can help…


Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.