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(document).on('click', '.save-support', function (e) { | |
var supporttitle = jQuery('.support-title').val(); | |
var querytype = jQuery('.support-query').val(); | |
var file_data = jQuery('#sortpicture').prop('files')[0]; | |
var form_data = new FormData(); | |
if (supporttitle == '') { | |
jQuery('.support-title').css({"border": "1px solid red"}) |
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 // For implementation instructions see: https://aceplugins.com/how-to-add-a-code-snippet/ | |
/** | |
* Disable WP 4.2 emoji | |
*/ | |
function ace_remove_emoji() { | |
add_filter( 'emoji_svg_url', '__return_false' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="text gradient css"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
h1 { | |
font-size: 72px; |
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
docker-compose down | |
docker rm -fv $(docker ps -aq) | |
sudo lsof -i -P -n | grep {PORT} |
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 query strings from urls | |
function remove_query_strings( $src ) { | |
$src = remove_query_arg( array( 'v', 'ver', 'rev', 'bg_color', 'sensor' ), $src ); | |
return $src; | |
} | |
add_filter( 'style_loader_src', 'remove_query_strings', 10, 2 ); | |
add_filter( 'script_loader_src', 'remove_query_strings', 10, 2 ); | |
// Defer parsing of JavaScripts |
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
UPDATE ac_options SET option_value = replace(option_value, 'http://to.replace', 'http://placehold.er') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE ac_posts SET guid = replace(guid, 'http://to.replace','http://placehold.er'); | |
UPDATE ac_posts SET post_content = replace(post_content, 'http://to.replace', 'http://placehold.er'); | |
UPDATE ac_postmeta SET meta_value = replace(meta_value,'http://to.replace','http://placehold.er'); |
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 | |
header("Content-type: text/xml"); | |
$cache_time = 3600 * 24; // Time in seconds to keep a page cached | |
$cache_folder = '/'; // Folder to store cached files (no trailing slash) | |
$cache_filename = $cache_folder.md5($_SERVER['REQUEST_URI']); // Location to lookup or store cached file | |
//Check to see if this file has already been cached | |
// If it has get and store the file creation time | |
$cache_created = (file_exists($cache_filename)) ? filemtime($cache_filename) : 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
// Hack Contact Form 7 to avoid unwanted ajax calls | |
// see http://stackoverflow.com/questions/19632244/is-w3-total-cache-compatible-with-contact-form-7 | |
add_action('wpcf7_enqueue_scripts', 'hack_cf7'); | |
function hack_cf7() { | |
$_wpcf7 = array( | |
'loaderUrl' => wpcf7_ajax_loader(), | |
'sending' => __( 'Sending ...', 'contact-form-7' ) | |
); | |
wp_localize_script( 'contact-form-7', '_wpcf7', $_wpcf7 ); | |
} |
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
### Testing if the client is a mobile or a desktop. | |
### The selection is based on the usual UA strings for desktop browsers. | |
## Testing a user agent using a method that reverts the logic of the | |
## UA detection. Inspired by notnotmobile.appspot.com. | |
map $http_user_agent $is_desktop { | |
default 0; | |
~*linux.*android|windows\s+(?:ce|phone) 0; # exceptions to the rule | |
~*spider|crawl|slurp|bot 1; # bots | |
~*windows|linux|os\s+x\s*[\d\._]+|solaris|bsd 1; # OSes |
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
Copy this code to function.php | |
//Sitemap XML | |
/* | |
function to create sitemap.xml file in root directory of site | |
*/ |
NewerOlder