Skip to content

Instantly share code, notes, and snippets.

@heckmac
Created December 3, 2013 18:54
Show Gist options
  • Save heckmac/7775283 to your computer and use it in GitHub Desktop.
Save heckmac/7775283 to your computer and use it in GitHub Desktop.
<?php query_posts('category_name=Portfolio&order=ASC&orderby=date&posts_per_page=36'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' );
$url = $thumb['0'];
?>
<li><a style="background-image:url(<?=$url?>);" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"></a></li>
<?php endwhile; ?>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment