Skip to content

versluis/P2-Categories

Repository files navigation

P2 Categories

This is a Fork of Automattic's P2 Theme, with added support for posting into categories via a handy drop-down menu on the front page.

This project has evolved from an article I've written which explained how to bring back posting into categories. The full process is explained here: http://wpguru.co.uk/2013/10/how-to-add-drop-down-categories-to-automattics-p2-theme/

What served as a working example is now a fully working theme which is compatible with Automattic's wonderful P2 (which is sadly no longer in development).

I have included several community suggested bug fixes and improvements that have not yet made it into P2 Core.

Installation

This entire project is a WordPress Theme. Download and install just like any other theme, either by uploading this repo as a ZIP, or by searching for "p2" under Appearance - Themes - Install.

How does P2 Categories work, and how do I use it?

Simply write your post from the front page (as you do on P2), then select a category from the drop down menu and hit post.

The menu only shows existing categories, even empty ones. You cannot create new categories from the front page though. To do so, please use the admin interface and head over to Posts - Categories, then add a new category.

Known Issues

Although the theme now works in PHP 7 without warnings, it appears there's a rather scary memory leak in the code somwehere. As a result, the memory the web server uses under PHP 7 eventually runs out, crashing your server.

It is therefore NOT recommended to run P2 Categories (or P2 for that matter) in PHP 7.x. Please use PHP 5.6 instead.

Further Reading

I've explained how these changes are made here: http://wpguru.co.uk/2013/10/how-to-add-drop-down-categories-to-automattics-p2-theme/

You can find a demo of the original P2 theme by Automattic here: http://p2theme.com

Check out my P2 User Guide at http://p2guide.wordpress.com

This theme is under review on WordPress.org: