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 to an .htaccess file at the top of the wp-admin directory to lock down this section of your site to only trusted IP addresses | |
// By Robin Scott of Silicon Dales - details here: https://silicondales.com/tutorials/wordpress/lock-out-all-traffic-except-your-ip-from-login-admin/ | |
Order Deny,Allow | |
Deny from all | |
Allow from X.X.X.X |
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 into your .htaccess file at the root of your WordPress installation. By Robin Scott of Silicon Dales. | |
// See full details here: https://silicondales.com/tutorials/wordpress/lock-out-all-traffic-except-your-ip-from-login-admin/ | |
<Files wp-login.php> | |
Order Deny,Allow | |
Deny from all | |
Allow from X.X.X.X | |
</Files> |
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
// Originally posted in official WooCommerce Github | |
// Re-posted by Robin Scott of Silicon Dales here https://silicondales.com/tutorials/woocommerce/declare-woocommerce-support-theme/ to aid understanding and benefit all in the Open Source community. Feel free to share are distribute as required! | |
function mytheme_add_woocommerce_support() { | |
add_theme_support( 'woocommerce', array( | |
'thumbnail_image_width' => 150, | |
'single_image_width' => 300, | |
'product_grid' => array( | |
'default_rows' => 3, | |
'min_rows' => 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
// Below declares woocommerce support when added to a theme or child theme functions.php - from the official WooCommerce Github (August 2018) | |
// Posted by Robin Scott of Silicon Dales here https://silicondales.com/tutorials/woocommerce/declare-woocommerce-support-theme/ to benefit the Open Source community. Free to share and distribute for any purpose. | |
function mytheme_add_woocommerce_support() { | |
add_theme_support( 'woocommerce' ); | |
} | |
add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' ); |
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
// place this in your child theme functions.php file to remove related products from WooCommerce | |
// posted by Robin Scott of Silicon Dales, here: https://silicondales.com/tutorials/woocommerce/remove-related-products-woocommerce/ | |
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 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
// Add this to child theme functions.php to change the way reviews display in WooCommerce to not show full name. | |
// Details here: https://silicondales.com/tutorials/woocommerce/woocommerce-change-review-author-display-name-username/ | |
// By Robin Scott for Silicon Dales | |
add_filter('get_comment_author', 'my_comment_author', 10, 1); | |
function my_comment_author( $author = '' ) { | |
// Get the comment ID from WP_Query | |
$comment = get_comment( $comment_ID ); | |
if (!empty($comment->comment_author) ) { | |
if($comment->user_id > 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
// How to add a shortcode into a PHP theme file in WordPress. By Robin Scott of Silicon Dales. More here: https://silicondales.com/tutorials/wordpress-tutorials/use-shortcodes-wordpress-theme-files/ | |
<?php echo do_shortcode("[YOURSHORTCODE]"); ?> |
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 the additional information tab from woocommerce - posted by Robin Scott of Silicon Dales @ https://silicondales.com/tutorials/woocommerce-tutorials/remove-tab-woocommerce/ | |
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['additional_information'] ); // Remove the additional information tab | |
return $tabs; | |
} |
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 the reviews tab from woocommerce - posted by Robin Scott of Silicon Dales @ https://silicondales.com/tutorials/woocommerce-tutorials/remove-tab-woocommerce/ | |
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['reviews'] ); // Remove the reviews tab | |
return $tabs; | |
} |
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 the description tab from woocommerce - posted by Robin Scott of Silicon Dales @ https://silicondales.com/tutorials/woocommerce-tutorials/remove-tab-woocommerce/ | |
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); // Remove the description tab | |
return $tabs; | |
} |