Today I learned a big lesson, and in a way, I got off easy. I was SSHed into one of my development boxes on Amazon EC2. I am currently in the middle of building a few client sites and they are all staged on one box. Now, I use EBS-backed EC2 instances, which means I […]
Archive | Snippets
RSS feed for this sectionMy Personal Collection Of Tips, Tricks and WordPress Best Practices
WordPress Debugging
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
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 […]
Get Rid of bbPress Breadcrumbs
Just add the following snippet to your functions.php: function custom_bbp_no_breadcrumb ($param) { return true; } add_filter (‘bbp_no_breadcrumb’, ‘custom_bbp_no_breadcrumb’); Twitter Facebook Google+ LinkedIn
Remove Pesky Width and Height on WordPress Images Using a Filter
Not the best way to go about it perhaps, but it works. Add the following filter to functions.php: // Remove the automatic width and height on images added by WordPress function remove_thumbnail_dimensions( $html, $post_id, $post_thumbnail_id, $size, $attr ) { $html = preg_replace( ‘/(width|height)=\”\d*\”\s/’, “”, $html ); return $html; } add_filter( ‘post_thumbnail_html’, ‘remove_thumbnail_dimensions’, 10, 5 ); […]
Introductions
Hi there, I’m Andy. I’m going to be using this space to post various tips & tricks I’ve learned over the years using WordPress. So … thanks for tuning in, more to come… Twitter Facebook Google+ LinkedIn
Testing 1…2…3
Is this thing on? Twitter Facebook Google+ LinkedIn