Archive | Snippets

RSS feed for this section

My Personal Collection Of Tips, Tricks and WordPress Best Practices

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 Place the following code in your functions.php file: // 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

How To Get Rid of the Admin Notice Install the WooThemes Updater plugin to get updates for your WooThemes plugins

04 May

If you’re running an older version of WooCommerce but aren’t and don’t want to use their updater, you can remove the notice Install the WooThemes Updater plugin to get updates for your WooThemes plugins that appears on every admin page by adding the following to your functions.php // Remove WooCommerce Updater remove_action(‘admin_notices’, ‘woothemes_updater_notice’); Twitter Facebook […]

Where is the MySQL Dump File in BackupBuddy Full Backup?

01 May

When you download your BackupBuddy backup to your local machine it’s not immediately obvious where the MySQL database dump is located. To find it, extract the ZIP file and look for the following folder : wp-content/uploads/backupbuddy_temp/MYSERIALCODE. The MYSERIALCODE part will match the backup name serial code. Hope that’s helpful! Twitter Facebook Google+ LinkedIn

No Nonsense WordPress Logout Link Without a Plugin

28 April

Add this WordPress Logout Link snippet and any logged in user can just go to /logout/ and they will be logged out: // WordPress Logout Link function sozot_logout_redirect() { $path = $_SERVER[‘REQUEST_URI’]; if ( !is_user_logged_in() ) { return; } // Allow Logged in Users to Log out from /logout/ if (preg_match(“~/logout~”, $path) or is_page(‘logout’)) { […]