I’ve just released a new version of my P2 Header Ad plugin! It fixes a few issues I’ve come across in debug mode:
- styles are now loaded via wp_enqueue_scripts hook
- fixed a debug warning that assumed a constant rather than a value
- verified compatibility with WordPress 4.5
There’s still a lone warning that appears in WordPress 4.5 Debug Mode. It reads something like “get_currentuserinfo is deprecated since version 4.5! Use wp_get_current_user() instead”.
This isn’t actually triggered by my plugin, but rather by the current version of P2 (1.5.8 and earlier). I’m sure the team will fix it very soon.
As always, you can download the plugin from
I’ve just updated my P2 Header Ad plugin with some new options:
- you can now display the same ad again after the post content (before the comments)
- you can do this on single posts, and additionally on the front page if you like
These options are not enabled by default and work best if you have longer posts on your site – the look a bit naff if you use your P2 site mainly for short status updates.
I’ve also spruced up the graphic assets that are used on WordPress.org while I was at it. Check out the new options in the Admin Interface (it’s still under Appearance – P2 Header Ad):
Note on Google Adsense ads
If you’re using both options above with Google Adsense ads, please note that those can only be shown up to 5 times on a single page. If your front page shows 5 posts or more, then the ad can no longer be displayed in the header (which is called last for performance reasons).
If you want to use the after-content-front-page-ad feature, and you want the header to show first, you can tweak line 293 of the main plugin file (p2-header-ad.php) from this
add_action ('get_footer', 'p2DisplayAdvert');
add_action ('get_header', 'p2DisplayAdvert');
I may make this an option in the admin interface in a future update. Let me know if you have any questions. Enjoy the plugin, you can download it from within WordPress, on WordPress.org on GitHub:
I’ve just released a new version of my P2 Header Ad plugin, adding the following features:
- added translation readiness
- added German Translation
- added Spanish Translation (thanks to Andrew Kurtis from WebHostingHub)
- verified WordPress 3.8 compatibility
You can get the latest version simply by using the WordPress updates (under Dashbaord – Updates), or download it from one of the links below:
I always loved Automattic’s P2 theme: it’s one of the most innovative ideas for blogging I could find. I’m using it on several of my notebook websites, including this one. I’ve been tweaking P2 for quite some time, and one thing I wanted to do is display an advert inside the P2 header.
As you may know, P2 doesn’t like child themes very much, so I wrote a future proof solution as this handy plugin.
P2 Header Ad let’s you display an advert of your choice inside the header. And when the theme is updated, your advert stays in place. Neat, huh?
Continue reading Introducing The P2 Header Ad Plugin