php query_posts orderby=random causing css to break

<?php query_posts($query_string . '&orderby=rand') ?>           

Hey all,

I’ve tried to implement the above piece of code into my portfolio page template.php.
http://www.some-things.net/category/work/

Read More

It’s causing the css to break every so often. Reload it until it breaks and you will see what I mean. It pushes 2 of the portfolioitem blocks to the right a touch and forces the third to drop a line?

<div style="clear:both"></div>
        <div class="gallery">
<?php query_posts($query_string . '&orderby=rand') ?>           
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

                <div class="portfolioItem">
                        <a href="<?php the_permalink() ?>" class="desctitle" title="<?php the_title();?>"><?php the_post_thumbnail(); ?>
                <span class="desctitle"><?php the_title(); ?></a>
</span>                     

                    </div>

            <?php endwhile; ?>
        </div>

Related posts

Leave a Reply

1 comment

  1. The error isn’t in the random layout code. It’s caused by an empty “tile” in your page. here’s the source of the offending tile:

    <div class="portfolioItem">
        <a href="http://www.some-things.net/work/love-jungle/" class="desctitle" title="Love Jungle"><span class="desctitle">Love Jungle</span></a>
    </div>
    

    Notice there’s no image.