Archive by Author

Customize the WooCommerce Breadcrumb HTML Markup

03 April

The easiest way to do this is to override the woocommerce_breadcrumb function. Add something like the following to your functions.php (obviously add whatever changes you want to make to the markup in the appropriate places): // Customize the WooCommerce breadcrumb if ( ! function_exists( ‘woocommerce_breadcrumb’ ) ) { function woocommerce_breadcrumb( $args = array() ) { […]

Remove / Dequeue Affiliates Pro Default Stylesheets

27 March

Here’s a simple function and hook combo you can add to your functions.php to dequeue the Affiliates Pro default stylesheets. function remove_affiliates_stylesheets() { wp_dequeue_style(‘affiliates’); wp_deregister_style( ‘affiliates’ ); } add_action( ‘wp_print_styles’, ‘remove_affiliates_stylesheets’, 101 ); You may alternatively need to swap the wp_print_styles with wp_enqueue_scripts like so: add_action( ‘wp_enqueue_scripts’, ‘remove_affiliates_stylesheets’, 101 ); Twitter Facebook Google+ LinkedIn

WordPress Debugging

26 March

OK, a simple one to start this thing off. If you’re writing PHP and you need to debug something and print some output to your error logs, here’s a nice custom debugging function that’s easier than the default error_log function. Certainly makes my life a lot easier. if(!function_exists(‘_error_log’)){ function _error_log( $stuff ) { if( WP_DEBUG […]

Enforce Alphanumeric Usernames in WordPress Registration

25 March

To kick things off, here’s a neat trick I recently figured out. One of my clients needed to enforce alphanumeric usernames so that users couldn’t enter email addresses and such as valid usernames. Turns out there’s a nice filter validate_username which does the trick nicely. You may need to customize the regex expression but here’s […]