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 fixImageMaps(force) { | |
var imgs = document.querySelectorAll("img[usemap]"); | |
[].forEach.call(imgs, function(img) { | |
if (!img.naturalHeight) { return; } | |
var h = img.height / img.naturalHeight; | |
var w = img.width / img.naturalWidth; | |
var map = document.getElementsByName(img.useMap.slice(1))[0]; | |
if (!map) { return; } | |
for (var i = 0; i < map.children.length; i++) { | |
var area = map.children[i]; |
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
.chosen { | |
select {} | |
.chzn-container-single { | |
.chzn-single { | |
span {} | |
div { | |
b {} |
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
for I in $(/Applications/MAMP/Library/bin/mysql -u root -p"password" -e 'show databases' -s --skip-column-names); do echo $I; /Applications/MAMP/Library/bin/mysqldump -u root -p"password" $I | gzip > "$I.sql.gz"; done |
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 | |
/* | |
* Only allow Admin users to view WP REST API JSON Endpoints | |
*/ | |
function mytheme_only_allow_logged_in_rest_access( $access ) { | |
if( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) { | |
return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'disable-json-api' ), array( 'status' => rest_authorization_required_code() ) ); | |
} | |
return $access; | |
} |
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 | |
/* | |
* Remove the WP REST API JSON Endpoints for logged out users | |
*/ | |
function mytheme_only_allow_logged_in_rest_access( $access ) { | |
if( ! is_user_logged_in() ) { | |
return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'disable-json-api' ), array( 'status' => rest_authorization_required_code() ) ); | |
} | |
return $access; | |
} |
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 this to fucntion.php to remove bad characters #038; from menues | |
// This is needed for older yootheme wir actual wordpress | |
add_action( 'wp_loaded', 'removebadchars' ); | |
function removebadchars() { | |
ob_start( 'html_cleaner' ); | |
} | |
function html_cleaner( $html ) { |
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
/** Deregister jQuery and jQuery-ui scripts loading from header */ | |
add_action('wp_enqueue_scripts', 'crunchify_script_remove_header'); | |
function crunchify_script_remove_header() { | |
wp_deregister_script( 'jquery' ); | |
wp_deregister_script( 'jquery-ui' ); | |
} | |
/** Register and Load jQuery and jQuery-ui script just before closing Body tag */ | |
add_action('genesis_after_footer', 'crunchify_script_add_body'); | |
function crunchify_script_add_body() { |
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
<script> | |
(function($) { | |
$(document).ajaxSuccess(function( event, xhr, settings ) { | |
dataLayer.push({ | |
'event': 'ajaxSuccess', | |
'eventCategory': 'AJAX', | |
'eventAction': settings.url, | |
'eventLabel': xhr.responseText | |
}); | |
}); |
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Remove the post info function | |
remove_action( 'genesis_before_post_content', 'genesis_post_info' ); |
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* This snippet needs to go before the following code: | |
//* Start the engine | |
//* require_once(TEMPLATEPATH.'/lib/init.php'); | |
//* Genesis Child Theme Language override | |
define('GENESIS_LANGUAGES_DIR', STYLESHEETPATH.'/languages'); | |
define('GENESIS_LANGUAGES_URL', STYLESHEETPATH.'/languages'); |
NewerOlder