Skip to content

Instantly share code, notes, and snippets.

View tombryan's full-sized avatar

Tom Bryan tombryan

View GitHub Profile
@tombryan
tombryan / gist:10460322
Created April 11, 2014 11:29
WooCommerce snippet for showing something only if there are items in the cart
<?php if( $woocommerce->cart->cart_contents_count > 0 ) : ?>
<!-- stuff -->
<?php endif;?>
<a title="Share" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>">Share on Facebook</a>
<a title="Tweet" href="https://twitter.com/share?url=&text=<?php the_title(); ?>: <?php echo urlencode(get_permalink($post->ID)); ?> &via=YOUR-TWITTER-USERNAME&count=horizontal">Tweet This</a>
<a title="PlusOne" href="https://plusone.google.com/_/+1/confirm?hl=en&url=<?php the_permalink(); ?>">+1</a>