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_filter( 'pre_site_transient_update_core', create_function( '$a', "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
remove_action( 'admin_notices', 'woothemes_updater_notice' ); |
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_action('get_header', 'start_ob'); | |
add_action('wp_head', 'end_ob', 999); | |
function start_ob() { | |
ob_start('remove_yoast'); | |
} | |
function end_ob() { | |
ob_end_flush(); | |
} |
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_action('woocommerce_before_shop_loop_item_title','product_out_of_stock_badge'); | |
function product_out_of_stock_badge() { | |
global $woocommerce, $product, $post; | |
$post_id = $post->ID; | |
$available_variations = $product->get_available_variations(); | |
foreach ($available_variations as $variation) { | |
$isinstock = $variation[is_in_stock]; | |
if ($isinstock === true) { | |
$i++; | |
} |
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
location / { | |
if (!-e $request_filename) { | |
rewrite ^/(.*)$ /index.php last; | |
break; | |
} | |
} | |
location /panel { | |
if (!-e $request_filename) { | |
rewrite ^/(.*)$ /panel/index.php last; |
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 | |
$unzip = new ZipArchive; | |
$out = $unzip->open('file-name.zip'); | |
if ($out === TRUE) { | |
$unzip->extractTo(getcwd()); | |
$unzip->close(); | |
echo 'File unzipped'; | |
} else { | |
echo 'Something went wrong?'; |
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 default thumbanail sizes on all blogs (works on Wordpress multisite also) | |
<?php | |
function remove_default_image_sizes( $sizes) { | |
unset($sizes['thumbnail']); | |
unset($sizes['medium']); | |
unset($sizes['large']); | |
return $sizes; | |
} | |
add_filter('intermediate_image_sizes_advanced','remove_default_image_sizes'); |
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
defaults write com.two.skype DataPath ~/Library/Application\ Support/Skype\ Two |
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
Installing new box for nginx-wordpress (ubuntu minimal): | |
Prepare server | |
------------------------------------ | |
apt-get update | |
apt-get upgrade | |
apt-get dist-upgrade #upgrade distribution | |
apt-get install sudo dialog software-properties-common python-software-properties | |
apt-get install bsdutils #for percona |
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
location /resize { | |
alias /tmp/nginx/resize; | |
set $width 150; | |
set $height 100; | |
set $dimens ""; | |
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
set $width $1; | |
set $height $2; | |
set $image_path $3; |
OlderNewer