WordPress


Google Analytics for WordPress plugin not tracking WP e-Commerce transactions?

Wednesday, 11th August 2010

I recently tried out Joost de Valk’s Google Analytics for WordPress (version 4) and was happy to see it supported ecommerce tracking for WP e-Commerce.

I had the latest version of WP e-Commerce installed, version 3.7.6.7, and configured the analytics plugin to track transactions but for some reason my ecommerce purchases were not being tracked by Google Analytics.

I did a bit of digging around and discovered the Analytics plugin was looking for the global variable $cart_log_id from which it could get the transaction details, but this variable did not seem to exist (it did seem to be in pre 3.7.6.x versions of WP e-Commerce though).

I have submitted a patch for this for the forthcoming WP e-Commerce version 3.8 (which is currently in beta and looking great, by the way).

In the meantime, if you’re having this problem here’s how you can fix it…

Read the rest of this entry »


WordPress.org Goshdarnit!

Tuesday, 20th July 2010

Was just browsing WordPress.org and got this server error message.

Matt, if there’s a WordPress problem is it always your fault?
Made me chuckle ;)


Body Classes for Styling WordPress Taxonomies

Thursday, 24th June 2010

I recently noticed that WordPress does not seem to add style classes to the body tag for custom taxonomies in the same way that it does on category archives.

You can fix this by adding the following to your functions.php file.

function taxonomy_body_class( $classes ) {
	if ( is_tax() ) {
		$tax = get_query_var( 'taxonomy' );
		$term = $tax . '-' . get_query_var( 'term' );
		$classes = array_merge( $classes, array( 'taxonomy-archive', $tax, $term ) );
	}
	return $classes;
}
add_filter( 'body_class', 'taxonomy_body_class' );

I don’t know why WordPress doesn’t do this automatically – I guess it should be added to core. What do you think?


Making your plugin meta boxes work with custom post types in WordPress 3.0

Friday, 18th June 2010

Getting to grips with custom post types in WordPress 3.0?

I am, and am finding they’re a great way to organise different content on your site and very easy to implement in just a few lines of code.

However, the challenge now is for plugin developers to make their plugins play nice with custom post types. The main thing I’ve noticed so far is that most plugins only tend to add meta boxes to posts and pages, so here’s the first step – getting your WordPress plugin meta boxes to work with custom post types.

Read the rest of this entry »


Category Paging Functions in WP e-Commerce 3.7.6

Wednesday, 10th March 2010

WP e-Commerce 3.7.6 now includes better support for paging on category pages.

The latest release contains a suite of functions (my little contribution) to help you customise how pagination is displayed in your WPSC templates.

You can find an in-depth look at these functions and how to use them in the WP e-Commerce Documentation.

Below are some quick examples of what you can do…

Read the rest of this entry »