Archive | Snippets

RSS feed for this section

My Personal Collection Of Tips, Tricks and WordPress Best Practices

WooCommerce Updates for 2026-10-27

27 October

Hello friends. A few WoCommerce plugin updates are now available for download: WooCommerce Customer Email Verification Version 3.0.6, Released on 2026-10-21 WooCommerce Gift Wrapper Version 7.0.0, Released on 2026-10-23 WooCommerce Tier-Pricing Table Version 10.1.2, Released on 2026-10-20 Tax Exempt for WooCommerce Version 1.9.6, Released on 2026-10-26 Walmart Integration for WooCommerce Version 5.0.0, Released on 2026-10-22 […]

Auto-Apply a Coupon for Specific Products in WooCommerce

03 February

Want a discount to apply automatically when a customer adds certain products to the cart—without forcing them to remember a coupon code? This snippet auto-applies (and removes) a chosen coupon based on product IDs in the cart. It also avoids applying in the admin and supports AJAX cart updates. Instructions: Replace the coupon_code and product […]

Suppress Function _load_textdomain_just_in_time was called incorrectly Notice

29 April

You’re getting this PHP Notice, and it’s cluttering up your logs, and you’re not going to patch upstream WordPress plugins, which would be silly: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the someplugin domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. […]

Enable Author Archives for Customers in WooCommerce

14 November

Add the following to snippet your theme’s functions.php file: /** * Revert WooCommerce “Disable author archives for customers.” ‘feature’ */ function remove_wc_disable_author_archives_for_customers() { remove_action( ‘template_redirect’, ‘wc_disable_author_archives_for_customers’, 10 ); } add_action( ‘after_setup_theme’, ‘remove_wc_disable_author_archives_for_customers’); Twitter Facebook Google+ LinkedIn

Fix bbPress Search in Canvas Theme

17 December

If you’re having trouble with bbPress searching in the Canvas theme you can try the following technique to get it resolved. Download the file bbpress.php from https://gist.github.com/mattyza/1b01583441b11c8d04d0 Place the following code in your functions.php file: //https://gist.github.com/mattyza/f210cadb7f70188d513d add_filter( ‘template_include’, ‘woo_custom_maybe_load_bbpress_tpl’, 99 ); function woo_custom_maybe_load_bbpress_tpl ( $tpl ) { if ( function_exists( ‘is_bbpress’ ) && is_bbpress() ) […]

Add Twitter Bootstrap Icons to Widget Titles in WordPress

03 July

Best option I’ve found is via a shortcode. Open your functions.php in your favorite text editor and first enable shortcodes for widget titles: add_filter(‘widget_title’, ‘do_shortcode’); Then, add your shortcode with the icon: add_shortcode(‘iconthlist’, ‘sozot_iconthlist’); function sozot_iconthlist() { return ‘<i class=”icon-th-list”></i>’; } Twitter Facebook Google+ LinkedIn