All work and no play makes for some interesting commit messages

Looks like Nacin could do with some sleep after 3.5 is out:

A neditor is a curious multi-celled organism found deep in the Content Management System “WordPress”. It generally subsides on good content. It has an obsession with retina-quality graphical elements, and also has a strong affinity for puns. Occasionally, ACCIDENTAL CAPS LOCK occurs. Some organisms carry British accents; these are prone to changing state but then reverting to their previous state soon after. One has shown superior sleuthing abilities, despite having hardly left its Uni laboratory. Organisms from Australia are usually found deeper in the Content Management System, most of its energy spent on locomotion.

The attitude of a neditor is best described as cranky optimism. Younger organisms are more eager, but quickly tire after working on little sleep. They eventually evolve into the cranky optimism stage in a process that generally takes three to five months.

WordPress commit message, Andrew Nacin

WordPress 3.5 Beta + Twenty Twelve

In just three short months, we’ve already made a few hundred changes to improve your WordPress experience. The biggest thing we’ve been working on is overhauling the media experience from the ground up. We’ve made it all fair game: How you upload photos, arrange galleries, insert images into posts, and more. It’s still rough around the edges and some pieces are missing — which means now is the perfect time to test it out, report issues, and help shape our headline feature. […]

We’re planning a December 5 release for WordPress 3.5. But, we have a special offering for you, today. The newest default theme for WordPress, Twenty Twelve, is now available for download from the WordPress themes directory. It’s a gorgeous and fully responsive theme, and it works with WordPress 3.4.2. Take it for a spin!

WordPress Development BlogAndrew Nacin, WordPress Lead Developer

There’s loads of great stuff coming in 3.5, I’d recommend following the commits on GitHub to keep up with everything.

You can also see a demo of Twenty Twelve on WordPress.com.

Prevent Firefox prefetching in WordPress

Using WordPress as an application layer today I came across an issue where everything was going fine and dandy in my browser testing, until I got to Firefox, which was odd since it was working fine in IE7-9.

The app was fairly simple, users arrive on the app, enter some details (not a username and password) that log them into WordPress, they complete a form that updates their details and on successful completion they go to a ‘thank you’ page that logs them out.

In Firefox I was able to get to the form stage, but no further, it kept kicking me back to the login, no matter what I did on the form.

Each state of the application was a page and of course WordPress being helpful added the rel="next" links to the header that Firefox went off to prefetch. I had written the app to log users out when they reached the thank you page so Firefox was logging me out as soon as I had logged in.

Luckily it was a fairly simple fix to remove the next and prev links using the following in the theme’s functions.php:

remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );

Trimming back Yoast SEO

Yoast’s WordPress SEO plugin is great. I use it on pretty much every WordPress site I deploy.

But recently it’s been getting more and more obtrusive, adding a bunch of columns to the admin screen and a ‘SEO analysis’ section to the publish meta box. Here’s a few lines you can drop into your themes functions.php to scale it back a bit, removing the columns, admin bar menu and page analysis

https://gist.github.com/3752340

For the more advanced user I’d recommend a look at the plugin API documentation.

Bringing responsive web design to P2

The P2 WordPress theme has had over a 280,000 downloads from the theme directory, is used on over 40,000 wordpress.com blogs and changed how Automattic communicates internally.

Reading the WordPress development blog, which uses P2, I noticed that it was serving a iPhone specific stylesheet but wasn’t responsive. Since I use WordPress so much myself and for clients I thought a good way to contribute to the community that makes such lovely open-source software would be to spend some time making P2 responsive.

The layout of P2 isn’t that complicated and the theme files are fairly logical so it didn’t take too long. Most of the adjustments were made with CSS, but there were a few things that needed moving around in the markup so they displayed well on small screens.

Today I’m making my work available as a child theme on GitHub. There’s one small Gotcha, which is the iPhone stylesheet. P2 serves the stylesheet using some code in the functions file in such a way as it can’t be overridden from a child theme, so you’ll need to comment out or delete lines 443-453 in p2/functions.php. It will work without this modification to the parent theme, but may appear incorrectly on iPhone’s.

Unfortunately I was only able to test it on the few devices I own, so I’d love to hear from anyone on an Android tablet or phone. But it should work fine in all modern browsers and iOS devices.

I’ve submitted my work to the Automattic theme team so hopefully in not too long a while the changes will be merged into the parent theme. In the meantime you can try out a demo of the theme or download a copy from GitHub.

Update – 16/1/2014v1.1.0 is now out which removes the need to modify the parent theme.