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 extendAccessToken() { | |
try { | |
// need to circumvent json_decode by calling _oauthRequest | |
// directly, since response isn't JSON format. | |
$access_token_response = | |
$this->_oauthRequest( | |
$this->getUrl('graph', '/oauth/access_token'), | |
$params = array('client_id' => $this->getAppId(), |
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 | |
/* Sometimes you don't need or want the relational links in Wordpress. Especially if you have pages in Wordpress you don't want to be public. Call with after_setup_theme action hook. | |
*/ | |
function remove_rel_links() { | |
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); | |
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); | |
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); | |
} |
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 | |
// Outputs the appropriate tags for Facebook Open Graph. Call using wp_head() action hook. Could be customized using conditional template tags for pages/posts/custom posts. | |
function fb_metatags() { ?> | |
<meta property="og:title" content="Page or Site Title" /> | |
<meta property="og:type" content="website" /> | |
<meta property="og:url" content="http://url.com" /> | |
<meta property="og:image" content="**url for image, could use wp-thumbnails here**" /> | |
<meta property="og:site_name" content="Site Title" /> | |
<meta property="fb:admins" 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 | |
//Use this function to create pagingation links that are styleable with Twitter Bootstrap | |
function paging() { | |
global $wp_query; | |
$total_pages = $wp_query->max_num_pages; | |
if ($total_pages > 1){ | |
$current_page = max(1, get_query_var('paged')); |
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 admin_bar_edit() { | |
global $wp_admin_bar; | |
$wp_admin_bar->remove_menu('comments'); | |
$wp_admin_bar->remove_menu('wp-logo'); | |
$wp_admin_bar->remove_menu('new-content'); | |
global $current_user; | |
get_currentuserinfo(); | |
$args = array( 'author' => $current_user->ID, 'post_type' => 'food_trucks', 'posts_per_page' => -1); | |
query_posts( $args ); |
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
/* | |
GA Aware Track Event Syntax | |
gaAware.track_event('Category', 'Action', 'Label', Count (1)); | |
Data Attribute to attach to item to track. May be worth breaking these into seperate data attributes to make things more semantic. Might also be able to swap the quote types, but haven't tested yet. | |
data-tracking='{"category":"x","action":"x","label":"x"}'' | |
*/ | |
var gaAware = jQuery(document).gaaware({ | |
UA: ['UA-2629988-12'], |
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
if(jQuery('.namespace_addthis').length > 0) { | |
jQuery.ajaxSetup({cache: true}); | |
jQuery(window).load(function(){jQuery.getScript('//s7.addthis.com/js/250/addthis_widget.js#pubid=', true);}); | |
jQuery(".namespace_addthis").each(function() { | |
jQuery(this).html('<div class="addthis_toolbox addthis_default_style addthis_32x32_style" ><a class="addthis_button_facebook"></a><a class="addthis_button_twitter"></a><a class="addthis_button_email"></a> <a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a></div>'); | |
}) | |
} |