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
# It's essential to periodically BU your DB, having this done while your sitting at the beach is a bonus, fortunately it's relatively simple even for server newbie like myself | |
# I also wanted to keep a BU for at least 6 days, so I went about setting up a cron to BU my "Time Stamped" DB, on the eight day I start removing date -7 day's , leaving me with a couple of days DB stock ::: | |
# IMPORTANT : add your own data or parameters, I make use of double segments [[ your variable ]]. eg. ssh root@[[ 96.172.44.11 ]] should be replaced with ssh [email protected] where "888.88.88.88" is your value, variable etc. I have a habit of using ":::" to indicate line ending and end of paragraph, crazy I know but be warned its just how I write ::: All notes are for my own use & should you use any it's at your own risk, it's NOT a Tutorial ::: | |
# Resources | |
# BIG THANKS TO @chrishough >> http://noconformity.com/blog/2013/04/15/linux-server-automation-scripts/ | |
# https://help.ubuntu.com/12.04/serverguide/backup-shellscripts.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
# Recovering a WordPress site thats been compromised is not fun, where to find all those images etc. etc. The solution, run a daily BackUp of the whole wp-content folder, then you have everything to restore your site ::: However if you backup your site every day this can drain your server resources if you have thousands of images ( remember each image in WP is duplicated AT LEAST 3 times ), imagine your BU running while you have a reasonable traffic ::: | |
# My solution is as follows ::: I used rsync which has a function that compares files then only adds new files/folders also removing files/folders not needed any more ::: I also wanted a 7 day backup solution, so what I do is I create a file each day "Uniquely Stamped" with each day eg. Monday is 01, Tuesday 02 you get the picture ::: Once we move on to the eight day we will be back where we started day 01 ( if BU's commenced on a Monday ) , on day 8, what will happen is that only files/folders added or deleted will be added and removed from the BU created a |
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
#!/bin/bash | |
#THX TO @chrishough : http://noconformity.com/blog/2013/04/15/linux-server-automation-scripts/ | |
#start | |
#----------------------------------------------------------------------- | |
#restart server | |
#DateStamp=$(date +"%Y%m%d %k:%M:%S"); | |
#echo $DateStamp >> /var/log/cron.reboot.log; | |
/sbin/shutdown -r now |
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
# Backing Up To DropBox just sounds "cool" so here we go ::: I'm running a Centos 6 VPN with Webmin and Virtualmin GPL install, with "reseller" accounts ( not that I sell, I just like the functionality ) so I needed a way to create nightly BU's of each account ::: Below are some links I found very handy ::: | |
# IMPORTANT : add your own data or parameters, I make use of double segments [[ your variable ]]. eg. ssh root@[[ 96.172.44.11 ]] should be replaced with ssh [email protected] where "888.88.88.88" is your value, variable etc. I have a habit of using ":::" to indicate line ending and end of paragraph, crazy I know but be warned its just how I write ::: All notes are for my own use & should you use any it's at your own risk, it's NOT a Tutorial ::: | |
# Resource | |
# http://kiteplans.info/2012/03/26/centos-virtualmin-server-backups-dropbox/ ( Centos ) | |
# http://www.dropboxwiki.com/Using_Dropbox_CLI | |
# https://whatbox.ca/wiki/Dropbox ( Ubuntu ) |
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 | |
/** | |
* Hook in on activation | |
*/ | |
global $pagenow; | |
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) add_action( 'init', 'yourtheme_woocommerce_image_dimensions', 1 ); | |
/** | |
* Define image sizes | |
*/ |
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_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_out_stock', 10); | |
function woocommerce_template_loop_out_stock() { | |
global $product; | |
if ( ! $product->managing_stock() && ! $product->is_in_stock() ) | |
echo '<p class="stock out-of-stock">Out of stock</p>'; | |
} |
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
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); |
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 | |
function the_slug() { | |
$post_data = get_post($post->ID, ARRAY_A); | |
$slug = $post_data['post_name']; | |
return $slug; | |
} | |
?> | |
Once done, simply call the function within the loop to get the post or page slug. |
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
/*----------------------------------------LAUDES----------------------------------------*/ | |
/* Mediaelements Controls */ | |
/*--------------------------------------------------------------------------------------*/ | |
.hentry .mejs-mediaelement, | |
.hentry .mejs-container .mejs-controls { | |
background: #191919; | |
} | |
.hentry .mejs-controls .mejs-time-rail .mejs-time-loaded, |