Archive | Snippets

RSS feed for this section

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

How to change the placeholder image for WooCommerce

14 November

Simple: // Add a custom placeholder image location add_filter( ‘woocommerce_placeholder_img_src’, ‘custom_placeholder_img_src’); function custom_placeholder_img_src () { return ‘/assets/placeholder.png’; } 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

Comments Off on Add Twitter Bootstrap Icons to Widget Titles in WordPress Continue Reading →

Remove Inline CSS from Query Multiple Taxonomies

12 May

Add to functions.php: / Don’t show the inline css for wp-query-multiple-taxonomies remove_action(‘wp_head’, array(‘QMT_Hooks’, ‘wp_head’)); 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 WooCommerce plugin extensions 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 Google+ LinkedIn

Comments Off on How To Get Rid of the Admin Notice Install the WooThemes Updater plugin to get updates for your WooThemes plugins Continue Reading →

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’)) { […]

WordPress Username Restrictions without a Plugin

26 April

On a recent project my client needed WordPress username restrictions but didn’t want to use a plugin. There are a few plugins out there that allow username restrictions but they are a bit overkill for this project and so I decided to just implemented it via a snippet in functions.php. Basically, there’s a list of […]

Remove page numbers from wp_head for post type archives with WordPress SEO

23 April

If you’ve got WordPress SEO enabled this can be a tricky one. Took a while to track down exactly where those /page/2s were being added to my custom post type archive. I removed get_pagenum_link and start_post_rel_link and finally figured out the culprit was WordPress SEO! Just add something like the following to your functions.php // […]

Comments Off on Remove page numbers from wp_head for post type archives with WordPress SEO Continue Reading →