P2 Archives

How to update legacy constructor methods in PHP 7

When I was fiddling with my P2 Categories theme last week, debug mode generated several warnings when run in PHP 7.2.1. That’s because class methods are no longer allowed to have the same name as the class itself. This was allowed in PHP 5 and earlier, but from what I gather it’s no longer the … Read more

How to display categories in Automattic’s P2 Theme

By default, Automattic’s phenomenal P2 theme does not support posting into categories from the front page, it only supports tags. My fork of the theme called P2 Categories does that though and lets you conveniently select a category from a drop down menu right there on the front page.

I wrote an update to it last week, and in so doing my article from 2013 came in handy that explains how to add this functionality to P2. Nothing much has changed in the source code, so it’s still relevant and accurate.

What the above article did not explain however was how to show which category a post belongs to. And because it’s still fresh in my  memory how to do this, I thought I’d better write it down for next time (and anyone who’s interested in how to do it).

Read more

How to swap the post title and date in P2

I’ve just posted this tweak in the WordPress P2 forum to help a user and thought I’d add it here too before I forget what I did. To swap the post title and date in P2 we’ll first grab a reference to each element, then we move one up and the other down. Like so: … Read more

How to fix JetPack 3.0 Sharing Icons in P2

JetPack 3.0 was released yesterday and it had quite a facelift: a new menu structure, dozens of graphical tweaks and a new set of Social Icons for sharing your posts. Those work well out of the box in TwentyThirteen and TwentyFourteen – but not in P2. Here’s how we can fix the problem. First let … Read more

How to use P2 (screencast)

In this video I will show you how to get the most out of the revolutionary P2 WordPress theme. It allows front-page posting and is an ideal solution for jotting down notes or communicating with others. I will explain how to create lists with simple shortcuts, add links, how to embed YouTube videos by simply … Read more

How to style block quotes in P2

I’ve just snazzed up the blockquotes styling on a couple of my P2 sites and thought I’d share the code that did it. Here’s an example of the final result in P2: This is a block quote. You can create one by adding blockquote tags to the beginning and end of a block of text … Read more