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 will generate a private PEM | |
openssl genrsa -out PATH-LOCATION/file_name_private.pem 1024 | |
// Now extract public key from the private pem and save it to a file | |
openssl rsa -in PATH-LOCATION/file_name_private.pem -pubout > PATH-LOCATION/file_name_public.pem |
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
$('a').each(function () { | |
if ($(this).attr('target') == '_blank') { | |
if ($(this).attr('rel')) { | |
this.rel += ' noopener noreferrer'; | |
} else { | |
$('a').attr('rel', 'noopener noreferrer'); | |
} | |
}; | |
}); |
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
// Replace WooCommerce product placeholder | |
function _custom_woocommerce_placeholder_img_src( $src ) { | |
$src = trailingslashit( get_template_directory_uri() ) . 'includes/images/placeholder.jpg'; // Change to required path and name | |
return $src; | |
} | |
add_filter( 'woocommerce_placeholder_img_src', '_custom_woocommerce_placeholder_img_src' ); |
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 remove_add_cart_loop( $button, $product ) { | |
$custom_button_text = __( "View product", "textdomain" ); | |
return '<a class="button" href="' . trailingslashit( esc_url( $product->get_permalink() ) ) . '">' . esc_attr( $custom_button_text ) . '</a>'; | |
} | |
add_filter( 'woocommerce_loop_add_to_cart_link', 'remove_add_cart_loop', 10, 2 ); |
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 bd_woocommerce_quantity_input_args( $args, $product ) { | |
$args['input_value'] = 1; // Starting value | |
$args['max_value'] = 800; // Maximum value | |
$args['min_value'] = 1; // Minimum value | |
$args['step'] = 1; // Quantity steps | |
return $args; | |
} | |
add_filter( 'woocommerce_quantity_input_args', 'bd_woocommerce_quantity_input_args', 10, 2 ); |
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 text before regular price and sale price | |
function bd_rrp_sale_price_html( $price, $product ) { | |
if ( $product->is_on_sale() ) : | |
$has_sale_text = array( | |
'<del>' => '<del>RRP: ', | |
'<ins>' => '<br>Sale Price: <ins>' | |
); | |
$return_string = str_replace(array_keys( $has_sale_text ), array_values( $has_sale_text ), $price); | |
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 Yoast data stuff | |
*/ | |
add_filter( 'wpseo_use_page_analysis', '__return_false' ); |
NewerOlder