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 to your theme's function.php file | |
/** | |
* Remove /kategorija/ from Yoast SEO canonical meta data | |
*/ | |
function custom_yoast_canonical( $canonical ) { | |
if ( is_product_category() ) { | |
$category = get_queried_object(); | |
$canonical = str_replace("kategorija/", "", get_term_link( $category, 'product_cat' )); |
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
/** | |
* Prevent update notification for plugin | |
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/ | |
* Place in theme functions.php or at bottom of wp-config.php | |
*/ | |
function disable_plugin_updates( $value ) { | |
if ( isset($value) && is_object($value) ) { | |
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) { | |
unset( $value->response['plugin-folder/plugin.php'] ); | |
} |
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 | |
/** | |
* Removes admin notices for outdated template files | |
*/ | |
function remove_template_files_notice() { | |
remove_action( 'admin_notices', 'wc_template_file_check' ); | |
} | |
add_action( 'admin_init', 'remove_template_files_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
<?php | |
/** | |
* Change TAX behaviour to prevent recalculating prices with VAT if VAT is different for other countrie, but instead price with VAT stays as it is. | |
*/ | |
add_filter( 'woocommerce_adjust_non_base_location_prices', '__return_false' ); | |
?> |
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 to display variations sale prices only when a variation on sale is selected | |
*/ | |
function action_wc_before_single_variation() { | |
?> | |
<script type="text/javascript"> | |
(function($){ | |
// Check for the show_variation event that triggers when a variation is selected. | |
$('form.variations_form').on('show_variation', function(event, data){ |
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 class if only 1 item left in stock | |
* Author: MarioMarkovic.com | |
*/ | |
function filter_get_stock_html( $html, $product ) { | |
// Low stock quantity amount | |
$low_stock_qty = 1; | |
$availability = $product->get_availability(); |
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 emoji support | |
remove_action('wp_head', 'print_emoji_detection_script', 7); | |
remove_action('wp_print_styles', 'print_emoji_styles'); | |
// // Remove rss feed links | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); | |
remove_action( 'wp_head', 'feed_links', 2 ); | |
// // remove wp-embed | |
add_action( 'wp_footer', function(){ |
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
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"> |
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
/** | |
* WooCommerce: Add To: Recipient to a Customer WooCommerce Email PROCESSING AND COMPLETED | |
* Author: MarioMarkovic.com | |
*/ | |
function wc_order_completed_email_add_to( $email_recipient, $email_object, $email ) { | |
$email_recipient .= ', info@example.com'; | |
return $email_recipient; | |
} | |
add_filter( 'woocommerce_email_recipient_customer_processing_order', 'wc_order_completed_email_add_to', 9999, 3 ); | |
add_filter( 'woocommerce_email_recipient_customer_completed_order', 'wc_order_completed_email_add_to', 9999, 3 ); |
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 ($) { | |
$.fn.serializeArrayAll = function () { | |
var rCRLF = /\r?\n/g; | |
return this.map(function () { | |
return this.elements ? jQuery.makeArray(this.elements) : this; | |
}).map(function (i, elem) { | |
var val = jQuery(this).val(); | |
if (val == null) { | |
return val == null | |
//next 2 lines of code look if it is a checkbox and set the value to blank |
NewerOlder