Jetpack: remove a post from the Top Posts Widget

If you use the Jetpack plugin, you’re probably familiar with the Stats module. Once you’ve activated the module, you can also use the Top Posts widget to display a list of the most popular posts on your site.

But what if there is one post that you never want to display there, even if it’s a popular one? You can exclude specific posts from the widget thanks to the jetpack_widget_get_top_posts filter.

To do so, paste the following code into a functionality plugin:

function jeherve_remove_post_top_posts( $posts, $post_ids, $count ) {
	foreach ( $posts as $k => $post ) {
		// Replace 1215 by the ID of the Post you want to remove
		if ( '1215' == $post['post_id'] ) {
			unset( $posts[$k] );
		}
	}
	return $posts;
}
add_filter( 'jetpack_widget_get_top_posts', 'jeherve_remove_post_top_posts', 10, 3 );

Get a headstart with install.php & Jetpack – TimiÈ™oara WordPress Meetup

I was invited to TimiÈ™oara to give a talk about Jetpack, and got to meet with the local WordPress community. It was a great meetup. Kudos to the folks from Presslabs, Rainfall, Cosmoslabs, and Get Bowtied. Thanks for being so welcoming. I’ll come again!

I chose to talk about install.php, and how you could use it alongside mu-plugins and functionality plugins to speed things up when installing new WordPress sites. Here are my slides:

Get a headstart with install.php & Jetpack

You can also check the slides on GitHub.

Here is the full install.php I created for the purpose of this talk. Credit goes to Mike Schinkel and Kathy for a big part of the functions in there.

If you have questions about some of the Jetpack filters used in the talk, or if you would like to see more filters added to Jetpack, do not hesitate to join us on GitHub!

A week in Hawaii

Working from home is great. It can get lonely at times though, especially when the rest of your team lives 6 timezones away. It makes it a bit more difficult to get to know each other, coordinate, and work efficiently as a team. Luckily for me, I work for Automattic and get to meet my teammates in person a few times a year!
Continue reading A week in Hawaii