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
// This snippet must be more or less public domain, because you can find it from several sources | |
// It is not coded by me, I just copied the snippet from somewhere | |
// Paste it in functions.php or use some custom functions plugin like Code Snippet | |
add_filter( 'woocommerce_dropdown_variation_attribute_options_args', 'ec_filter_dropdown_args', 10 ); | |
function ec_filter_dropdown_args( $args ) { | |
$args['show_option_none'] = 'Choose...'; | |
return $args; | |
} |
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 my_last_updated_date( $content ) { | |
$u_time = get_the_time('U'); | |
$u_modified_time = get_the_modified_time('U'); | |
if ($u_modified_time >= $u_time + 86400) { | |
$updated_date = get_the_modified_time('F jS, Y'); | |
$updated_time = get_the_modified_time('h:i a'); | |
$custom_content .= '<p class="last-updated entry-meta"><b>Last updated on '. $updated_date . ' at '. $updated_time .'</b></p>'; | |
} | |
$custom_content .= $content; | |
return $custom_content; |
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 if(! defined('ABSPATH')){ return; } | |
/** | |
* Details date | |
*/ | |
?> | |
<span class="kl-blog-post-date updated" <?php echo WpkPageHelper::zn_schema_markup('post_time'); ?>> | |
<?php | |
echo "Posted on "; | |
$date_format = zget_option( 'blog_date_format', 'blog_options', false, 'l, d F Y' ); |
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
#!/bin/bash | |
for post in $(wp post list --field=ID) | |
do | |
count=$(wp post term list $post 'category' --fields='name' --format="count") | |
if [ "$count" -gt "1" ] | |
then wp post term remove $post category 'uncategorized' | |
fi | |
done | |
## chmod 755 remove-category.sh |
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
#!/bin/bash | |
for post in $(wp post list --field=ID) | |
do | |
count=$(wp post term list $post 'category' --fields='name' --format="count") | |
if [ "$count" -gt "1" ] | |
then wp post term remove $post category 'yleinen' | |
fi | |
done | |
## chmod 755 poista-yleinen.sh |
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
<VirtualHost 127.0.0.1:8080> | |
ServerAdmin email@example.com | |
ServerName example.com | |
ServerAlias www.example.com | |
DocumentRoot /var/www/html | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
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
### example.tld | |
check host example.tld with address www.example.tld | |
# ICMP check | |
if failed icmp type echo | |
for 2 times within 2 cycles | |
then alert | |
# HTTP check | |
if failed port 80 protocol http |
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
### example.tld | |
check host example.tld with address www.example.tld | |
# ICMP check | |
if failed icmp type echo | |
for 2 times within 2 cycles | |
then alert | |
# HTTP check | |
if failed port 80 protocol http |
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
# Apache2 | |
check process apache2 with pidfile /var/run/apache2/apache2.pid | |
group www-data | |
start program = "/bin/systemctl start apache2" with timeout 30 seconds | |
stop program = "/bin/systemctl stop apache2" | |
if failed host localhost port 80 with protocol http | |
and request "/server-status" for 2 times within 2 cycles then restart | |
depend apache_bin | |
depend apache_rc | |
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
# Rewriting on | |
RewriteEngine on | |
# redirect to same page in the new site as where a user was in the old site | |
RewriteBase / | |
RewriteCond %{SERVER_NAME} =old-domain.com [OR] | |
RewriteCond %{SERVER_NAME} =new-domain.com | |
RewriteRule ^ http://new.domain.com%{REQUEST_URI} [END,NE,R=301] |
OlderNewer