Skip to content

Instantly share code, notes, and snippets.

View jerewall's full-sized avatar

Jeremy Wallace jerewall

View GitHub Profile
$('img.swap').click(function() {
var src = ($(this).attr('src'));
var swap = ($(this).data('swap'));
$(this).attr('src', swap );
$(this).data('swap', src );
});
// <img src="images/pic1.jpg" data-swap="images/pic2.jpg" class="swap">
@jerewall
jerewall / gist:e31c87b254b158fb88a3
Created February 13, 2015 16:21
Emmet Make a Gallery using Tab
a[href="gallery/gallery$.jpg" rel="gallery"]*10>img[src="gallery/gallery$.jpg" alt="Gallery Image"]
Sample Ouput:
<a href="gallery/gallery1.jpg" rel="shadowbox"><img src="gallery/gallery1.jpg" alt="Gallery Image"></a>
<a href="gallery/gallery2.jpg" rel="shadowbox"><img src="gallery/gallery2.jpg" alt="Gallery Image"></a>
<a href="gallery/gallery3.jpg" rel="shadowbox"><img src="gallery/gallery3.jpg" alt="Gallery Image"></a>
<a href="gallery/gallery4.jpg" rel="shadowbox"><img src="gallery/gallery4.jpg" alt="Gallery Image"></a>
<a href="gallery/gallery5.jpg" rel="shadowbox"><img src="gallery/gallery5.jpg" alt="Gallery Image"></a>
<?php $my_query = new WP_Query( 'posts_per_page=3' );
while ( $my_query->have_posts() ) : $my_query->the_post();
$do_not_duplicate = $post->ID; ?>
<div class="entry">
<h3><?php the_title(); ?></h3>
<?php the_excerpt(); ?>
<a class="readmore" href="<?php the_permalink(); ?>">Read more &#187;</a>
</div>
<?php endwhile; ?>