• Magento Duplicate Orders MySQL Search

    A handy MySQL query to check a Magento DB for potential duplicate orders! SELECT `quote_id`, COUNT(`quote_id`) AS `qty_duplicates`, `increment_id` AS `first_increment_id`, GROUP_CONCAT( `increment_id` SEPARATOR ‘ | ‘ ) AS `increment_ids`, `created_at`, `state`, `status`, `customer_firstname`, `customer_lastname`, `customer_email`, `grand_total` FROM `sales_flat_order` GROUP BY `quote_id` HAVING COUNT(`quote_id`) > 1 ORDER BY `created_at` ASC

  • Displaying Custom Post Type Archive on Your WordPress Homepage

    Here’s how to do it! add_action( ‘pre_get_posts’, ‘my_query_mods’ ); function my_query_mods( $query ){ if( is_admin() ) return; if( is_main_query() && is_home() ) $query->set( ‘post_type’, ‘texture’ ); }

  • Need a category index page?

    Why not just use a normal page? Oh, sure, you want a dynamically loading list of the categories. Try this on for size: add_shortcode( ‘taxonomy-list’, ‘my_taxonomy_list’ ); function my_taxonomy_list( $atts ) { $args = shortcode_atts( array( ‘taxonomy’ => ‘category’, ‘title_li’ => ”, ‘depth’ => 1, ‘hide_empty’ => 1, ), $atts ); ob_start(); ?> <ul class=”taxonomy-list…

  • CSS3 Snow!

    So I got a bit irked the other day when looking to sort out what sort of method I’d like to use for putting snow on a website.  All the options just looked bad.  Some were using images (which I’d prefer to avoid) — others were using crazy javascript hijinks.  I figured there’d have to…

  • The Seven Deadly Theming Sins

    Here’s my slides from my talk earlier at WCPhilly Download: Seven Deadly Theming Sins

  • I’ll be speaking at WordCamp Philly 2012!

    Looks like I’ve been accepted to speak this year at WordCamp Philly!  I’ll be rambling on about the “Seven Deadly Sins of Theming” — a look at the ghastliest and most horrifying grievances that are made against best practices when making themes — specifically those for commercial consumption. My main bullet points (so far) are:…

  • How to change post thumbnail crop position in WordPress WITHOUT HACKING CORE

    DISCLAIMER: This requires WordPress 3.4 to work correctly. The filter was added based on Trac Ticket #15989 Okay, to start, here is the function that we’re going to be working with, from ~/wp-includes/media.php : /** * Retrieve calculated resized dimensions for use in imagecopyresampled(). * * Calculate dimensions and coordinates for a resized image that fits…

  • WordCamp Boston 2012

    I’ll be speaking this year at WordCamp Boston!  Date and time to follow as I learn more, but my talk will be titled “Old, New, Borrowed, and Blue” — we’ll be looking at the classic ‘Kubrick’ theme that shipped with WordPress until 3.0, and bringing it up to date with HTML5 and CSS3! The theme…

  • Detect mobile devices in WP 3.4

    So there’s a new function in town for detecting mobile browsers — no need to rely on the syntactically incorrect $is_iphone! Azaozz added in the new wp_is_mobile(); — no parameters, and it returns a Boolean — true or false.  Its a great way to future-proof your code, and outsource the browser detection to core, rather…

  • Windows Phone 7 is Obnoxious

    Especially when trying to manage dropdown/flyout menus. I’m trying to sort out a way to make the WP core admin UI friendly to Mobile IE, but it doesn’t actually care about the `ontouchstart` event.  At all. All it sees are clicks.