Set up CloudFlare’s free Flexible SSL on your WordPress site

I’ve been meaning to play with CloudFlare’s free SSL options for a while, and I finally got around to give it a try. It took me a little while to get to a point where everything worked properly, but I think I finally figured everything out!

If you want to use CloudFlare’s free Flexible SSL on your WordPress site, here are some instructions that could help you!

Continue reading Set up CloudFlare’s free Flexible SSL on your WordPress site

Jetpack: how to deal with missing images in the Related Posts module

Jetpack Related Posts are great. You should use them!

They are also customizable; we added a lot of filters to allow you to customize the output of the Related Posts. You can find a lot of examples here: Customize Related Posts (Kudos to Xiao for all the great work he’s done with Jetpack Related Posts).

The module also includes an option to “use a large and visually striking layout”. When that option is active, Jetpack will look for a large image (at least 350*200px) in your posts, and use that image when displaying Related Posts. It looks great, and I use it on this site:

Related Posts

What doesn’t look that good, however, is when some of the Related Posts don’t have any image.

Missing Related Image

There are 2 ways to solve this small issue.

Continue reading Jetpack: how to deal with missing images in the Related Posts module

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!

Blast off with Jetpack – WPBudapest meetup

Last night, I gave a talk about Jetpack at our local #WPBudapest meetup. If you live in Budapest and like WordPress, you should join us next time!

And until next month, you can check my slides here:

Blast off with Jetpack

Discover the Jetpack plugin, and why should you give it a try on your WordPress site.

If you have any questions about my presentation, let me know!

Jetpack: add hashtags to the twitter sharing button

A few days ago I explained how to add hashtags to the tweets sent out by Jetpack Publicize. But what about the tweets your read can send using the Jetpack Sharing buttons at the bottom of your posts?

Here is how to get tags from your posts, and add them as hashtags to the twitter sharing button. As always, you’ll want to paste that code in a functionality plugin.

function jeherve_custom_sharing_title() {
        $post = get_post();
        if ( empty( $post ) ) {
                return;
        } else {
                // Create sharing title
                $sharing_title = get_the_title( $post->ID );

                // Get the tags
                $post_tags = get_the_tags( $post->ID );
                if ( ! empty( $post_tags ) ) {
                        // Create list of tags with hashtags in front of them
                        $hash_tags = '';
                        foreach( $post_tags as $tag ) {
                                $hash_tags .= ' #' . $tag->name;
                        }
                        // Add tags to the title
                        $sharing_title .= $hash_tags;
                }

                return $sharing_title;
        }
}
add_filter( 'sharing_title', 'jeherve_custom_sharing_title', 10, 3 );

Hat tip to Ryan for the idea!