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
jQuery(function( $ ){ | |
$(window).scroll(function () { | |
if ($(document).scrollTop() > 200 ) { | |
$('.builder-module-1-background-wrapper').addClass('shrink'); | |
} else { | |
$('.builder-module-1-background-wrapper').removeClass('shrink'); | |
} | |
}); | |
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
//* Enqueue Scripts | |
add_action( 'wp_enqueue_scripts', 'ni_shrinking_header_script' ); | |
function ni_shrinking_header_script() { | |
wp_enqueue_script( 'shrinking-header', get_bloginfo( 'stylesheet_directory' ) . '/js/shrinking-header.js', array( 'jquery' ), '1.0.0', true ); | |
} |
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
/********************************************* | |
Incredible Shrinking Header CSS | |
*********************************************/ | |
/* Sticky Top Module */ | |
.builder-module-1-background-wrapper { | |
background: #15384E; | |
position: fixed; | |
width: 100%; |
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
// Prefill Gravity Form with User Data | |
function populate_usermeta($meta_key){ global $current_user; | |
return $current_user->__get($meta_key); | |
} | |
add_filter('gform_field_value_userfirstname', create_function("", '$value = populate_usermeta(\'user_firstname\'); return $value;' )); | |
add_filter('gform_field_value_userlastname', create_function("", '$value = populate_usermeta(\'user_lastname\'); return $value;' )); | |
add_filter('gform_field_value_useremail', create_function("", '$value = populate_usermeta(\'user_email\'); return $value;' )); | |
add_filter('gform_field_value_userwebsite', create_function("", '$value = populate_usermeta(\'user_url\'); return $value;' )); |
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
// First Name of Logged In User Shortcode | |
function ni_firstname() { | |
$user = wp_get_current_user(); | |
$firstname = $user->user_firstname; | |
return $firstname; | |
} | |
add_shortcode('firstname', 'ni_firstname'); |
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
// Change the Theme My Login Login Template Header | |
function tml_title_filter( $title, $action ) { | |
if ( 'login' == $action ) return ''; | |
return $title; | |
} | |
add_filter( 'tml_title', 'tml_title_filter', 10, 2 ); |
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
// Remove Visual Composer Nag | |
add_action('admin_init', function() | |
{ | |
setcookie('vchideactivationmsg', '1', strtotime('+3 years'), '/'); | |
}); |
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
//Remove Visual Composer Meta Data | |
add_action('init', 'myoverride', 100); | |
function myoverride() { | |
remove_action('wp_head', array(visual_composer(), 'addMetaData')); | |
} |
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
//Anti-Spam Email Shortcode | |
//Use this shortcode [emailme]nathan@brilliantly.net[/emailme] | |
function protect_email_address( $atts , $content=null ) { | |
for ($i = 0; $i < strlen($content); $i++) $encodedmail .= "&#" . ord($content[$i]) . ';'; | |
return '<a href="mailto:'.$encodedmail.'">'.$encodedmail.'</a>'; | |
} | |
add_shortcode('emailme', 'protect_email_address'); | |
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_theme_support( 'builder-responsive', array('tablet-width' => '1023px', 'mobile-width' => '767px' )); |
OlderNewer