Skip to content

Instantly share code, notes, and snippets.

jonathanhudak / index.html
Created April 23, 2013 02:26 — forked from mfkp/index.html
ajax mailchimp signup form
<!DOCTYPE html>
<script type="text/javascript" src=""></script>
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">
jonathanhudak / Wordpress List Recent Posts Excluding Current Post
Created April 27, 2013 20:15
A snippet to list recent posts with their post thumbnail on the Single.php template, which excludes the current Single Post.
<div class="recent-post-list">
$the_query = new WP_Query(array('showposts' => 5, 'orderby' => 'post_date', 'order' => 'desc', 'offset' => 1, 'post__not_in' => array( $post->ID )));
while ($the_query->have_posts()) : $the_query->the_post(); ?>
<div class="recent-post">
<a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark">
<?php the_post_thumbnail(array(50,50, true), array ('')); ?>
<h3><?php the_title(); ?></h3>
<div class="clear"></div>
$post_image_url = $post_image[0];
$the_content = get_the_content();
$content_cleaned = strip_shortcodes( $the_content );
$new_excerpt = wp_trim_words( $content_cleaned, 35 );
$json_posts[] = array('title' => get_the_title(),'content'=>get_the_content(), 'excerpt'=>$new_excerpt, 'url'=>get_permalink(get_the_ID()), 'thumbnail'=>$post_image_url, 'post_class'=>$postClass);
jonathanhudak / gist:7033217
Created October 17, 2013 22:14
triangle mixins
@mixin triangle($direction:up, $color:#000, $size:100px) {
@if($direction == up) {
border-color: transparent transparent $color;
border-style: solid;
border-width: 0 $size $size;
height: 0;
width: 0;
@if($direction == down) {
border-color: $color transparent transparent transparent;
jonathanhudak / gist:7033237
Created October 17, 2013 22:15
Double border
@mixin trim-border($thinColor, $thickColor) {
0 0 0 1px $thinColor,
0 0 0 9px $thickColor;
//@include box-sizing(content-box);
wp_register_script('livereload', 'http://localhost:35729/livereload.js?snipver=1', null, false, true);
wp_enqueue_script('livereload'); //keep this at the bottom
// this code creates a variable for your template assets path for use with require.js
$WP_DIRECTORY = array( 'path' => get_stylesheet_directory_uri() . '/js' );
wp_localize_script( 'require', 'directory', $WP_DIRECTORY );
jonathanhudak / A-Pen-by-Jonathan-Hudak.markdown
Created November 13, 2013 05:17
A Pen by Jonathan Hudak.
jonathanhudak / gist:8305736
Created January 7, 2014 19:53
sharer links
<a class="share-icon share-icon-email pop" href="mailto:?subject=<?php echo urlencode(the_title()); ?>&body=<?php the_permalink(); ?>" title="Send a link to this post via email" rel="nofollow">Share this post via email</a>
<a class="share-icon share-icon-facebook pop" href="<?php echo get_permalink(); ?>&t=<?php echo get_the_title(); ?>" target="_blank" title="Share This on Facebook">fb</a>
<a class="share-icon share-icon-twitter pop" href="<?php echo urlencode(the_title()); ?>&url=<?php echo urlencode(the_permalink()); ?>&via=twitter" title="Share on Twitter" rel="nofollow" target="_blank">Tweet This</a>
<a class="share-icon share-icon-tumblr pop" href="<?php echo urlencode(get_permalink()) ?>&name=<?php echo urlencode(get_the_title()) ?>&description=<?php echo urlencode(the_excerpt()) ?>" target="_blank" title="Share on Tumblr">Share on Tumblr</a>