This file contains hidden or 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
/** | |
* Javascript function to load the corresponding image based on window resolution. | |
* | |
* Usage: | |
* <div id='story' data-adaptive-bg='{ | |
* "desktop": "/static/img/banners/press/press-1920x1080.jpg", | |
* "tablet": "/static/img/banners/press/press-992x500.jpg", | |
* "mobile": "/static/img/banners/press/press-768x400.jpg" | |
* }'> | |
* </div> |
This file contains hidden or 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 to the body_class function | |
function condensed_body_class($classes) { | |
global $post; | |
// add a class for the name of the page - later might want to remove the auto generated pageid class which isn't very useful | |
if( is_page()) { | |
$pn = $post->post_name; | |
$classes[] = "page-".$pn; | |
} |
This file contains hidden or 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_filter( 'bbp_get_reply_author_link', 'my_append_badges_via_filter', 10, 2 ); | |
function my_append_badges_via_filter($author_link = '', $args) { | |
# Needed to get the user ID of the person intended to be displayed. | |
$user_id = bbp_get_reply_author_id( $args['post_id'] ); | |
#Construct your output here. | |
$badge_output = ''; |
This file contains hidden or 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_shortcode('wiki_page','my_wiki_page'); | |
function my_wiki_page($atts, $content) { | |
ob_start(); | |
$post_type = 'incsub_wiki'; | |
// Gets every "category" (term) in this taxonomy to get the respective posts | |
//$terms = get_terms( 'wiki_category' ); |
This file contains hidden or 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 | |
// track conversions in Gravity Forms | |
function add_conversion_tracking_code($button, $form) { | |
$dom = new DOMDocument(); | |
$dom->loadHTML($button); | |
$input = $dom->getElementsByTagName('input')->item(0); | |
if ($input->hasAttribute('onclick')) { | |
$input->setAttribute("onclick","ga('send', 'click', 'submit');".$input->getAttribute("onclick")); | |
} else { |
This file contains hidden or 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 | |
class Client { | |
public $domain = "https://api.linkedin.com"; | |
/** | |
* Authorization and AccessToken api endpoints are special in that they live on www.linkedin.com not api.linkedin.com | |
*/ | |
public $authorizationUrl = "https://www.linkedin.com/uas/oauth2/authorization"; | |
public $accessTokenUrl = "https://www.linkedin.com/uas/oauth2/accessToken"; |
This file contains hidden or 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 add_conversion_tracking_code($button, $form) { | |
$dom = new DOMDocument(); | |
$dom->loadHTML($button); | |
$input = $dom->getElementsByTagName('input')->item(0); | |
if ($input->hasAttribute('onclick')) { | |
$input->setAttribute("onclick","ga('send', 'event', { eventCategory: 'GTM_Category', eventAction: 'GTM_Action', eventLabel: 'GTM_Label'});".$input->getAttribute("onclick")); | |
} else { | |
$input->setAttribute("onclick","ga('send', 'event', { eventCategory: 'GTM_Category', eventAction: 'GTM_Action', eventLabel: 'GTM_Label'});"); | |
} | |
return $dom->saveHtml(); |
This file contains hidden or 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( 'body_class', 'my_body_class' ); | |
function my_body_class( $class ) { | |
global $current_blog; | |
$class[] = 'site-' . $current_blog-> blog_id; | |
return $class; | |
} | |
?> |