An Alternative to @import in WordPress Child Themes

Using Child Themes in WordPress is a great way to modify an existing theme, however the CSS @import directive is slower than it has to be, so you should try and avoid it. Here’s why.

If it takes 200ms to load the child theme’s stylesheet, and 200ms to load the parent theme’s CSS, a modern web browser should take approximately 200ms to load both of them, because modern browsers load assets in parallel.

Unfortunately this is not true for CSS @import. Let me quote Google:

The browser must download, parse, and execute first.css before it is able to discover that it needs to download second.css.

Which means that instead of 200ms, with @import it’ll take the web browser approximately 400ms to load both stylesheets. Here’s a typical child theme’s CSS:

/**
 * Theme Name: My Child Theme
 * Template: parent-theme
 */
@import url(../parent-theme/style.css);

/* My Child Theme CSS */

We can drop the @import statement, and make good use of functions.php and the wp_enqueue_style() function:

// Faster than @import
add_action( 'wp_enqueue_scripts', 'my_child_theme_scripts' );
function my_child_theme_scripts() {
    wp_enqueue_style( 'parent-theme-css', get_template_directory_uri() . '/style.css' );
}

And we don’t need to re-declare dependencies because the child theme’s functions.php is loaded before the parent theme’s. Unless, of course, the parent theme uses a different action priority, in which case we should just match it.

That’s +1 to our PageSpeed score :)

Introducing Semicolon

Semicolon is a brand new magazine theme for WordPress. It’s simple, clean, and it’s got quite a unique grid layout with support for featured posts.

Semicolon WordPress Theme

Semicolon was initially created for WP Magazine, an online news site about WordPress in Russian. It’s got support for featured posts, a social profiles menu, related posts, author bios, and a few widget areas.

Head over to the demo to take a look around. The latest version is always available for download on WordPress.org (don’t forget to rate it!), and if you ever get stuck, please visit the the FAQ and the support forums.

Semicolon is based on the amazing _s starter theme, and is distributed for free under the GNU GPL. Enjoy!

Expound: A Free Magazine Theme for WordPress

Meet Expound — a free magazine theme for WordPress. Freshly baked, straight out of the oven, filled with _s goodness, a responsive layout, wicked support for featured posts and more!

Expound Magazine Theme for WordPress

Expound was initially built for WP Magazine, a little blog with a big goal to change the perception of WordPress in Russia. It supports up to five featured posts on the home page, post thumbnails, custom excerpts, threaded comments, a sidebar for your widgets, a related posts section built right in, and an awesome responsive layout to keep your readers reading, wherever they are.

You can get Expound from the WordPress.org repository, and don’t hesitate to give a thumbs up if you like it. Enjoy!

Theme Publish is now on WordPress.com

I released a WordPress theme called Publish earlier this month, and today, thanks to the awesome Theme Team of Automattic, Publish has been made available to all WordPress.com users.

WordPress Theme Publish

Publish is a clean and minimal WordPress theme, perfect for (but not limited to) single-author blogs. While working on shipping Publish to WordPress.com customers, a bunch of improvements have been made to the theme itself, like support for uploading a custom logo (vs using Gravatar), better compatibility with many sidebar widgets and more.

I’m excited to see how Publish does on WordPress.com, and looking forward to launching more themes. You can start a new blog on WordPress.com with Publish or head over to WordPress.org for the downloadable version. Enjoy!

Publish: A Free Minimal and Responsive WordPress Theme

I’m pleased to announce that Publish is now available for download in the WordPress.org themes directory. Publish is a theme I’ve been working on for quite a while, started back last year and then released to GitHub in February this year. When I started contributing to _s, I did a complete revamp of the theme, but kept the main intent — a minimal blogging theme with focus on the content.

Publish is ideal for single-author blogs, but supports multi-author blogs too. To change the “logo” Gravatar, you’ll need to change the main administrator e-mail address via Settings – General. Publish supports navigation menus, has a sidebar for your widgets, implements threaded comments, has support for various post formats and the sticky post. It has also got a responsive layout, with a drop-down menu for mobile devices. Other features, including post thumbnails, are on their way, so hang in there, or submit a patch!

Give it a spin and let me know what you think. Since theme reviews are live on WordPress.org, I’d really appreciate one, whether good or bad. If you would like to contribute to Publish, feel free to open pull requests or issues on GitHub.

What WordPress Theme Developers Can Learn from Twenty Twelve

We’ve all been waiting for the new default theme for WordPress, and it has finally arrived. Without a doubt, Twenty Twelve is one of the best themes I’ve ever played with. It’s so simple, clean, good-looking and filled with so much awesomeness inside.

Twenty Twelve for WordPress

I’m sure that by now you have downloaded the theme, or at least checked out the demo. In this short review I’d like to point out the things that make Twenty Twelve so awesome, and what you can learn from it. If you find other gems worth mentioning, don’t forget to share them by posting a comment.

Continue reading