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 | |
add_action( 'wp_enqueue_scripts', 'fw_theme_enqueue_styles', 100 ); | |
function fw_theme_enqueue_styles() { | |
$dependencies = array(); // add here other theme handles, for example from the parent theme or WooCommerce | |
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', $dependencies, '1.0.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
<?php | |
// remove the category description above the product list | |
remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); | |
// add the category description below the product list | |
add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 100 ); |
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 | |
/* | |
Place this code in your functions.php file to show a short description before the grid on product categorie archive pages. | |
Disclaimer: Use this code snippet with extreme care and at your own risk. | |
*/ | |
add_action('woocommerce_archive_description', function() { | |
if (!is_paged() && is_product_category()) { | |
if (function_exists('get_field')) { | |
$term_id = get_queried_object()->term_id; | |
echo ' |
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 | |
/* | |
Copy/paste deze code in het functions.php bestand van je child theme. | |
Disclaimer: | |
Afhankelijk van je website instellingen is het mogelijk | |
dat deze code niet werkt of zelfs een storing in je website oproept. | |
Het gebruik van deze code gebeurd op eigen risico! | |
*/ |
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 | |
function getInvoices($contact, $page = 0) { | |
global $link, $api, $today, $year_ago; | |
$filters = array( | |
'contact_id' => $contact, | |
'is_sent' => 1, | |
'invoice_date' => array($year_ago, $today) | |
); | |
//print_r($filters); |
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 | |
add_action('wp_footer', 'fw_get_user_for_clicky'); | |
function fw_get_user_for_clicky() { | |
$current_user = wp_get_current_user(); | |
if ( $current_user->exists() ) { | |
// Vraag je klant/gebruiker eerst om toestemming voordat je deze code toont | |
echo ' | |
<script type="text/javascript"> | |
var clicky_custom = clicky_custom || {}; | |
clicky_custom.visitor = { |
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 | |
// add this code snippet to your child theme's functions.php file | |
add_filter('comment_form_default_fields', 'fw_remove_comment_author_url'); | |
function fw_remove_comment_author_url($fields) { | |
if (isset($fields['url'])) { | |
unset($fields['url']); | |
} | |
return $fields; | |
} |
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 this code to your .htaccess file (Apache based servers only) | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} \.(jpg|jpeg|png|gif|bmp|ico|css|js|swf|htm|html|txt|php|asp|aspx)$ [NC] | |
RewriteRule .* - [L,R=404] | |
</IfModule> |
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/sh | |
# Find out what databases are in mysql and back them up | |
# Delete old backups | |
STARTTIME=` date +%Y%m%d-%H%M ` | |
BACKUP_DIR="/srv/users/serverpilot/apps/backups" | |
LOGFILE="/srv/users/serverpilot/apps/backups/db_backup.log" | |
USER="root" | |
PASSWD="ENTER_ROOT_PASSWORD" | |
KEEP="20" |
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 | |
// place this code snippet to the functions.php file from your WordPress child theme | |
add_action("current_screen", "redirect_user_add"); | |
function redirect_user_add() { | |
if (!empty($_GET['id'])) { | |
$currentScreen = get_current_screen(); | |
if ($currentScreen->id == "users") { | |
wp_redirect( admin_url("/user-edit.php?user_id=".(int)$_GET['id']) ); |