This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
## Truncate Post | |
function custom_excerpt_length(){ | |
global $excerpt_length; | |
return $excerpt_length; | |
} | |
function custom_excerpt_more(){ | |
global $excerpt_more; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> | |
<div class="row"> | |
<?php | |
global $wp_query; | |
$postid = $wp_query->post->ID; | |
$big_video = get_post_custom_values('Big_Video'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function js_add_review($content) { | |
global $post; | |
$content = $content.js_ratings_box(); | |
$guide = get_post_custom_values('MakeProjectsGuideNumber'); | |
if (isset($guide[0])) { | |
$content .= js_make_project($guide); | |
} | |
return $content; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//error_reporting(E_ALL); | |
if ( function_exists( 'wpcom_is_vip' ) && wpcom_is_vip() ) { | |
// Load the WordPress.com dependent helper file | |
wpcom_vip_load_helper_wpcom(); // vip-helper-wpcom.php | |
} else { | |
// These two plugins are automatically loaded on WordPress.com | |
require_once( WP_CONTENT_DIR . '/themes/vip/plugins/vip-do-not-include-on-wpcom/vip-local-development-helper/vip-local-development-helper.php' ); | |
require_once( WP_CONTENT_DIR . '/themes/vip/plugins/vip-do-not-include-on-wpcom/vip-powered-wpcom/vip-powered-wpcom.php' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', 'make_sopa_blackout' ); | |
function make_sopa_blackout() { | |
if ( ! is_admin() ) { | |
$current_time = current_time( 'timestamp' ); | |
$start_time = strtotime( '2012/01/17 8:00' ); | |
$end_time = strtotime( '2012/01/17 20:00' ); | |
if( $current_time >= $start_time && $current_time <= $end_time ) { | |
wp_redirect( 'http://oreilly.com/make-blackout.html', 503 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
For a simple way to keep track of the number of post views, paste this snippet into the functions.php, and then follow steps 1 and 2. | |
*/ | |
function getPostViews($postID){ | |
$count_key = 'post_views_count'; | |
$count = get_post_meta($postID, $count_key, true); | |
if($count=='' || $count==0){ | |
delete_post_meta($postID, $count_key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function avada_kedavra() { | |
if(round(rand())){ | |
return 'Rebound!!!! Dodge?'; | |
} | |
die('Avada Kedavra!!!!'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
<script> | |
jQuery(function(\$) { | |
${1://put all your jQuery goodness in here.} | |
}); | |
</script> | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>jqready</tabTrigger> |
OlderNewer