Old and new, living together.
A Pen by hudakdidit on CodePen.
<div class="recent-post-list"> | |
<?php | |
$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> | |
</a> | |
<div class="clear"></div> |
Old and new, living together.
A Pen by hudakdidit on CodePen.
$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); |
@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; |
@mixin trim-border($thinColor, $thickColor) { | |
box-shadow: | |
0 0 0 1px $thinColor, | |
0 0 0 9px $thickColor; | |
//@include box-sizing(content-box); | |
} |
//functions.php | |
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 ); |
A Pen by Jonathan Hudak on CodePen.
<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="http://www.facebook.com/sharer/sharer.php?u=<?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="http://twitter.com/share?text=<?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="http://www.tumblr.com/share/link?url=<?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> |
<h1>Editing {{.Slug}}</h1> | |
<form action="/save/{{.Slug}}" method="POST"> | |
<div><textarea name="body" rows="20" cols="80">{{printf "%s" .Body}}</textarea></div> | |
<div><input type="submit" value="Save"></div> | |
</form> |
#!/bin/sh | |
mysqldumpdb() { | |
if [ -z "$1" ] | |
then | |
echo "Specify mysql database name as parameter #1" | |
else | |
now=$(date +"%s") | |
cmd="mysqldump -uroot -proot $1 | gzip > /Users/jonathan/Desktop/$1-$now.sql.gz" | |
echo $cmd | |
eval $cmd |