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 ( ! is_admin() ) { | |
wp_dequeue_styles( 'cmb2-styles' ); | |
} | |
// or this? | |
apply_filters( 'cmb2_enqueue_css', false ); |
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
function bp_rename_profile_tabs() { | |
buddypress()->members->nav->edit_nav( array( | |
'name' => __( 'Dashboard', 'textdomain' ), | |
'slug' => __( 'dashboard', 'textdomain' ) | |
), 'activity' ); | |
} | |
add_action( 'bp_actions', 'bp_rename_profile_tabs' ); |
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
/** | |
* Foo Script. | |
*/ | |
window.Foo_Object = {}; | |
( function( window, $, that ) { | |
// Private variable. | |
var fooVariable = 'foo'; | |
// Constructor. |
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
/** | |
* Back To Top. | |
*/ | |
window.Back_To_Top = {}; | |
( function( window, $, that ) { | |
// Private variables. | |
var minWidth = 768; | |
var minHeight = 200; |
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
( function($) { | |
var menuToggle = $('.menu-toggle'); | |
var overlay = $('.overlay'); | |
var closeButton = $('.overlay-close'); | |
var searchToggle = $('.search-toggle'); | |
var searchForm = $('.search-form'); | |
var ww = window.innerWidth; |
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
// Usage: | |
// get_id_by_slug( 'any-page-slug' ); | |
function get_id_by_slug( $page_slug ) { | |
$page = get_page_by_path( $page_slug ); | |
if ( $page ) { | |
return $page->ID; | |
} else { | |
return null; |
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 | |
/** | |
* Maintainn Gravity Forms Hooks & Filter overrides | |
* | |
*/ | |
/* | |
* Filter the Gravity Forms button type and add your own .class | |
*/ | |
function your_prefix_form_submit_button( $button, $form ) { |
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
// check if element is in viewport | |
// if so, then add/remove class | |
// http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport/7557433#7557433 | |
(function($) { | |
// function to check if element is in viewport | |
function inViewport(element) { | |
if (typeof jQuery === "function" && element instanceof jQuery) { | |
element = element[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
# Apache .htaccess | |
RedirectMatch 301 ^/wp-content/uploads/(.*) http://livewebsite.com/wp-content/uploads/$1 | |
# Nginx | |
location ~ ^/wp-content/uploads/(.*) { | |
rewrite ^/wp-content/uploads/(.*)$ http://livewebsite.com/wp-content/uploads/$1 redirect; | |
} |