Skip to content

Instantly share code, notes, and snippets.

View whyisjake's full-sized avatar
✈️

Jake Spurlock whyisjake

✈️
View GitHub Profile
@whyisjake
whyisjake / mt_conditional
Created November 16, 2011 19:14
Movable Type Conditional
<div class="adbanner" style="float: left; width: 728px;">
<mt:If tag="EntryTitle" eq="Giveaway: Huge Shutterfly Photography Prize Pack with Digital Camera">
<!-- FM Leaderboard Zone -->
<script type='text/javascript' src='http://static.fmpub.net/zone/307'></script>
<!-- FM Leaderboard Zone -->
<mt:else>
<!-- cz_giftguide_728x90 -->
@whyisjake
whyisjake / gist:1372394
Created November 17, 2011 04:55
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 );
@whyisjake
whyisjake / functions.hp
Created November 17, 2011 05:37
kits functions
<?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' );
@whyisjake
whyisjake / gist:1383491
Created November 21, 2011 18:43
CSIF for ads
//This is in the layout
<script type='text/javascript' src='http://partner.googleadservices.com/gampad/google_service.js'>
</script>
<script type='text/javascript'>
GS_googleAddAdSenseService("ca-pub-1711976718738240");
GS_googleEnableAllServices();
</script>
<script language="JavaScript">
GA_googleAddAttr("Sponsor", "");
@whyisjake
whyisjake / rules.txt
Created November 29, 2011 19:50
ReWrite Rules
string(16375) "WP_Rewrite::__set_state(array(
'permalink_structure' => '/%year%/%monthnum%/%postname%/',
'use_trailing_slashes' => true,
'author_base' => 'author',
'search_base' => 'search',
'comments_base' => 'comments',
'pagination_base' => 'page',
'feed_base' => 'feed',
'comments_feed_structure' => NULL,
SimpleXMLElement Object
(
[Products] => Array
(
[0] => SimpleXMLElement Object
(
[AutoDropShip] => N
[DoNotAllowBackOrders] => N
[LastModBy] => 287
[LastModified] => 12/21/2010 2:18:00 PM
@whyisjake
whyisjake / index.php
Created November 30, 2011 22:12
MakerShed Embederattor
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Maker Shed Thingamagoop</title>
<meta name="generator" content="BBEdit 10.1" />
<style type="text/css">
</style>
</head>
@whyisjake
whyisjake / youtube.php
Created December 7, 2011 03:27
make_youtube_embed
<?php
function make_youtube_embed($width,$height) {
global $wp_query;
$big_video = get_post_custom_values('Big_Video');
?>
<iframe width="<?php echo esc_html($width); ?>" height="<?php echo esc_html($height); ?>" src="http://www.youtube.com/embed/<?php echo esc_html($big_video[0]); ?>?showinfo=0&hd=1&wmode=transparent" frameborder="0" allowfullscreen wmode="Opaque"></iframe>
@whyisjake
whyisjake / feat.php
Created December 7, 2011 03:37
Featured Products
<?php
$input = range(1,30);
$arr = array_rand($input, 4);
error_reporting('E_All');
$request_url = 'http://makershed.com/net/webservice.aspx?api_name=generic\featured_products';
$xml = simplexml_load_file($request_url) or die('feed not loading');
$products = $xml->Product;
@whyisjake
whyisjake / feat.php
Created December 12, 2011 22:34
js_featured_products
function js_featured_products() {
$input = range(1,30);
$arr = array_rand($input, 4);
$request_url = 'http://makershed.com/net/webservice.aspx?api_name=generic\featured_products';
$xml = simplexml_load_file($request_url);