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
<?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 | |
#Google syntax highlighter fix | |
add_action('wp_loaded', 'gshf'); | |
add_filter('tiny_mce_before_init', 'gshf'); | |
function gshf($init_array){ | |
if(isset($init_array)){ | |
$ext = 'pre[id|name|class|style]'; | |
if ( isset( $init_array['extended_valid_elements'] ) ) { |
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
$('label').each(function(i){ | |
var l = $(this); | |
var offset = $('#'+l.attr('for')).offset(); | |
l.css({position: 'absolute', top: offset.y+5, left: offset.x+10}); | |
}); | |
$('input').focus(function(event){ | |
var t = $(this); | |
// hide label |
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 | |
$show = !empty(do_shortcode('[show_to]true[/show_to]')); | |
if($show): | |
?> | |
content goes here | |
<?php | |
endif; |
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 | |
add_shortcode('bookmarklet', 'print_bookmarklet'); | |
function print_bookmarklet(){ | |
echo '<a href="'.$bookmarklet_code.'">'.$bookmarklet_text.'</a>'; | |
} |
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
add_action('login_head', 'sa_login_styles'); | |
function sa_login_styles(){ | |
echo '<link rel="stylesheet" type="text/css" href="'.get_bloginfo('stylesheet_directory').'/login.css">'; | |
} |
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 nmc_event_search_filter_join($join){ | |
global $wpdb; | |
$join .= "INNER JOIN ".$wpdb->postmeta." AS mtsd1 ON (".$wpdb->posts.".ID = mtsd1.post_id) INNER JOIN ".$wpdb->postmeta." AS mted1 ON (".$wpdb->posts.".ID = mted1.post_id) INNER JOIN ".$wpdb->postmeta." AS mtsd2 ON (".$wpdb->posts.".ID = mtsd2.post_id) INNER JOIN ".$wpdb->postmeta." AS mted2 ON (".$wpdb->posts.".ID = mted2.post_id)"; | |
return $join; | |
} |
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 echo get_post_meta(get_the_ID(), 'primary-contact-name', true); ?> | |
<?php echo get_post_meta(get_the_ID(), 'primary-contact-phone', true); ?> | |
<?php echo get_post_meta(get_the_ID(), 'primary-contact-extension', true); ?> | |
<?php echo get_post_meta(get_the_ID(), 'primary-contact-email', true); ?> | |
<?php echo get_post_meta(get_the_ID(), 'secondary-contact-name', true); ?> | |
<?php echo get_post_meta(get_the_ID(), 'secondary-contact-phone', true); ?> | |
<?php echo get_post_meta(get_the_ID(), 'secondary-contact-extension', true); ?> | |
<?php echo get_post_meta(get_the_ID(), 'secondary-contact-email', true); ?> |