Skip to content

Instantly share code, notes, and snippets.

@ninnypants
ninnypants / gist:1372411
Created November 17, 2011 05:10 — forked from whyisjake/gist:1372394
functions for make:projects
function js_add_review($content) {
global $post;
$original = $content;
$content = js_ratings_box();
$content .= $original;
return $content;
}
add_filter( 'the_content', 'js_add_review', 15 );
@ninnypants
ninnypants / for.php
Created November 14, 2011 01:53 — forked from whyisjake/gist:1363050
for
<?php get_header(); ?>
<div class="row">
<?php
global $wp_query;
$postid = $wp_query->post->ID;
$big_video = get_post_custom_values('Big_Video');
@ninnypants
ninnypants / jQuery with a PHP array...
Created October 27, 2011 04:20 — forked from whyisjake/jQuery with a PHP array...
Looking for an easy way to load a php array into some jQuery... Any ideas on how to simplify this?
<script>
post_ids = <?php echo json_encode(array(185,4,171)); ?>;
$(document).ready(function(){
/* Put your jQuery here */
$('.post-'+post_ids[1]).hide();
$('.post-'+post_ids[2]).hide();
$('.click'+post_ids[0]).addClass('active');
@ninnypants
ninnypants / truncate_post
Created October 22, 2011 04:03 — forked from whyisjake/js_excerpt
Simple function to Change the length of an excerpt.
<?php
## Truncate Post
function custom_excerpt_length(){
global $excerpt_length;
return $excerpt_length;
}
function custom_excerpt_more(){
global $excerpt_more;