More responsiveness for WooCommerce 2.1 default stylesheet

Written by Alexis Nominé on . Posted in WordPress

Following my article on how to add responsiveness to WooCommerce 2.0 default stylesheet, here is how to add more responsiveness to WooCommerce 2.1.

In this great new version, WooThemes developers decided to separate layout from the rest of the style. Which is good news because it's a lot easier to identify where css has to change to be responsive. What I like less is that responsive behavior they added is too limited: only one "breakpoint" around 768px, so it doesn't adapt that well to the available space on screen of the variety of devices (smartphones, phablets, tablets ...).

So let's update it with 4 breakpoints so the product grid grows from 1 to 4 products per line, with a bit of "mobile first" flavour.

If you want to get straight to the point, you can download the updated stylesheet here, upload it in your theme folder, and add this in your functions.php file:

After the break, the updated "woocommerce-layout.less" with some comments:

Continue Reading

A bit of responsiveness for WooCommerce 2.0 default stylesheet

Written by Alexis Nominé on . Posted in WordPress

WooTheme folks are making one of the best eCommerce plugins for WordPress: WooCommerce. Their last themes - like SuperStore - are using their own responsive stylesheet for WooCommerce. However, the default stylesheet applied when using another theme (say TwentyTwelve) could use some improvement to be fully responsive.

If you want to get straight to the point, you can download the updated stylesheet here, upload it in your theme folder, and add this in your functions.php file:

add_action( 'wp_enqueue_scripts', 'change_woo_styles', 99 );
function change_woo_styles() {
	wp_dequeue_style( 'woocommerce_frontend_styles' );
	wp_enqueue_style( 'woocommerce_responsive_frontend_styles', get_stylesheet_directory_uri()."/woocommerce.css" );
}

More details explaining the changes I made after the break.

Continue Reading

Conditional bbPress 2.3 styles and scripts

Written by Alexis Nominé on . Posted in WordPress

bbPress is one of the best forum plugins available for WordPress. However, one shortcoming of the current version (2.3) is that styles and scripts are loaded on every WordPress page even if not needed. This is not a best practice in for your website performance. Here is a quick fix for that:

In a plugin or in the functions.php file of your theme, just add:

// clean bbpress stuff outside of bbpress
add_action( 'wp_head', 'conditional_bbpress_head', 9 );
function conditional_bbpress_head(){
	if( !is_bbpress() )
		remove_action( 'wp_head', 'bbp_head' );
}
add_action( 'wp_enqueue_scripts', 'conditional_bbpress_scripts', 9 );
function conditional_bbpress_scripts(){
	if( !is_bbpress() )
		remove_action( 'wp_enqueue_scripts', 'bbp_enqueue_scripts' );
}

Now, the head should be cleaner on every other part of your site, and the loading time greatly improved.

Multilingual Press (free) : add custom post type support

Written by Alexis Nominé on . Posted in WordPress

17/04/2012: Updated for Multilingual Press 1.0.3

Multilingual Press plugin allows to have a multilingual WordPress, using a multisite installation. It does his job very well except it works only with posts and pages for the free version. If you want to enable it on your custom post types, you can either buy the pro version or follow two simple steps, after the break. Continue Reading