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($) { | |
var defaults = {}; | |
$.fn.fixedscroll = function(opts) { | |
var options = $.extend(defaults, opts); | |
var el = $(this); |
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
var menu = $j('#menu'), | |
menulink = $j('.menu-link'), | |
menuTrigger = $j('.has-submenu > a'); | |
menulink.click(function(e) { | |
e.preventDefault(); | |
menulink.toggleClass('active'); | |
menu.toggleClass('active'); | |
}); |
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
//Logout Shortcode | |
function logout_func ($atts, $content = null) { | |
extract(shortcode_atts(array( | |
'linktext' => 'Log Out', | |
), $atts)); | |
$logoutlink = wp_logout_url( home_url() ); | |
return '<a href="' . $logoutlink . '" title="Logout">'. $linktext .'</a>'; | |
} | |
add_shortcode( 'wplogout', 'logout_func' ); | |
?> |
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 | |
function simple_pagination($pages = '', $range = 2){ | |
$showitems = ($range * 2)+1; | |
global $paged; | |
if(empty($paged)) $paged = 1; | |
if($pages == '') | |
{ |
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_filter('the_content', 'my_nofollow'); | |
add_filter('the_excerpt', 'my_nofollow'); | |
function my_nofollow($content) { | |
return preg_replace_callback('/<a[^>]+\\.pdf/', 'my_nofollow_callback', $content); | |
} | |
function my_nofollow_callback($matches) { | |
$link = $matches[0]; | |
$link = preg_replace("%(href=\S(?!$link))%i", 'rel="nofollow" $1', $link); | |
return $link; | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
jQuery( document ).ready( function( $ ) { | |
var $menu = $('#menu'), | |
$menulink = $('.menu-link'), | |
$menuTrigger = $('.has-submenu > a'); | |
$menulink.click(function(e) { | |
e.preventDefault(); | |
$menulink.toggleClass('active'); | |
$menu.toggleClass('active'); |
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_filter( 'woocommerce_variation_option_name', 'display_price_in_variation_option_name' ); | |
function display_price_in_variation_option_name( $term ) { | |
global $wpdb, $product, $woocommerce; | |
if ( empty( $term ) ) return $term; | |
if ( empty( $product->get_id() ) ) return $term; | |
$result = $wpdb->get_col( "SELECT slug FROM {$wpdb->prefix}terms WHERE name = '$term'" ); |
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
<a href=(["'])(?:(?=(\\?))\2.)*?\1> |
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 | |
// Click to tweet functionality. Look for the username and hashtags at the end of the string. | |
$main_question = get_the_title(); | |
$twitter_quote = get_field('twitter_quote'); | |
?> | |
<div class="tweet-this"> | |
<a class="click-tweet" href="http://twitter.com/share?text=<?php echo html_entity_decode($main_question); ?> "<?php if($twitter_quote) { echo urlencode($twitter_quote); } ?>" via <?php echo $fullname . ' ' . $twitter_handle; ?>&url=<?php echo $roundup_permalink; ?>&hashtags=backswing @getbackswing" target="_blank"> | |
Click to Tweet | |
</a> |