Jetpack

Tiles and Circles and Squares, Oh My!

Jetpack has lots of different modules that do all sorts of fun and interesting things to supercharge your self-hosted WordPress site. Not everyone uses all of these modules, though — with so much good stuff, it’s easy to miss something. To help you discover all the great things you could be doing with Jetpack, we’ll be highlighting the most-overlooked modules and the modules we get asked the most about. First up: Tiled Galleries!

Are you tired of plain old thumbnail galleries? Are row after row of tiny squares getting you down? Do you spend tons of time using photo editing software to create more interesting layouts for your images? Well have no fear, Tiled Galleries are here! Jetpack lets you display images in a variety of bold, elegant layouts with just a few clicks.

To insert a gallery into a post or page, the first thing you need, of course, are some images. Do you want to showcase your recent trip to New Mexico? Or maybe that new puppy you got? Any collection of images can be turned into a Tiled Gallery, whether you uploaded them to your site weeks ago or are just uploading them now.

Then, make sure that you’ve enabled the Tiled Galleries module in Jetpack. Activate it by going to the Jetpack page in your dashboard, and click the blue “Activate” button on the Tiled Galleries card.

Next, you’ll want to insert a new gallery into your page or post. To add a gallery, click on the “Add Media button,” and then on “Create Gallery” on the top left. You can then either upload new images or select images that are already in your media library. Choose the images you want, then click on the “Create a Gallery” button on the bottom right. Once you’ve created the Gallery, you can drag-and-drop the pictures to put them in the order you want them to appear in.

Now the fun part: choose the layout style that you want for your gallery, in the “Gallery Settings” area on the right, and let the Tiled Galleries module work its magic. You can have:

Square Tiles

or Circles

and my favorite, Tiled Mosaic

Great pictures, aren’t they? And they look smashing in the Tiled Galleries. Jetpack takes care of all the cropping and arrangement, and your site visitors can click any tile to pull up the full image.

I hope this inspires you to turn your regular Thumbnail Galleries into stylish Jetpack-powered Tiled Galleries!

Do you have any questions about Tiled Galleries? Is there a particular Jetpack module you’d like to learn more about? Let us know!

Posted in Features, Tips & Tricks | Tagged , , , | 23 Comments

How to use your own resources in the sharing module

The sharing module includes an “advanced” option, allowing you to use your own Javascript and CSS files instead of the files added by Jetpack by default.

To get started, go to Settings > Sharing in your dashboard, and check the “Advanced” checkbox at the bottom of the page.

Then, you can add your own libraries by adding the following code in a functionality plugin or in your theme’s functions.php file:

function tweakjp_add_sharing_js() {
    wp_enqueue_script( 'sharing-js', WP_SHARING_PLUGIN_URL . 'sharing.js', array( ), 3 );
}
add_action( 'wp_enqueue_scripts', 'tweakjp_add_sharing_js' );

function tweakjp_add_sharing_css() {
    wp_enqueue_style( 'sharing', WP_SHARING_PLUGIN_URL. 'sharing.css', false, JETPACK__VERSION );
}
add_action( 'wp_enqueue_scripts', 'tweakjp_add_sharing_css' );

Once you’ve checked the option, you will be able to manually enqueue your own sharing js and css files.

You’ll note that Jetpack uses the WP_SHARING_PLUGIN_URL constant to build the path to load the libraries. You will have to change that constant by your own when reenqueueing the sharing libraries.

Reference

Posted in Code snippets, Tips & Tricks | Tagged | Comments Off

Skip an Image with Photon

Once you activate the Photon module, it will automatically cache and serve all images you’ve added to your posts and pages that have been uploaded to your site.

You can exclude a specific image or an entire page from Photon easily.

To exclude an entire post or page from using Photon, you can modify this snippet to fit your needs and add it to your theme’s functions.php or a core functionality plugin:

function no_photon_by_page() {
  if ( is_page( 2 ) ) {
    add_filter( 'jetpack_photon_skip_image', '__return_true');
  }
}

add_action('wp', 'no_photon_by_page');

In this example, Photon won’t be used on the page with the ID of 2, but you can use any of the WordPress Conditional Functions.

If you’d like to exclude an image from being cached and served by Photon, you can add the following code to your theme’s functions.php file:

function my_photon_exception( $val, $src, $tag ) {
        if ( $src == 'YOUR_IMAGE_URL' ) {
                return true;
        }
        return $val;
}
add_filter( 'jetpack_photon_skip_image', 'my_photon_exception', 10, 3 );

If you’d like to disable Photon in other specific situations instead, you can check this tutorial.

Posted in Code snippets, Tips & Tricks | Tagged | Comments Off

How to remove Publicize options from the New Post screen

Publicize adds a set of options right above the “Publish” button in your dashboard. You can hide these options by adding the following code to a functionality plugin, or to your theme’s functions.php:

// Replace with admin_head-post.php for the edit post screen
add_action( 'admin_head-post-new.php', function() {
        global $publicize_ui;
        remove_action( 'post_submitbox_misc_actions', array( $publicize_ui, 'post_page_metabox' ) );
} );

Reference

Posted in Code snippets, Tips & Tricks | Tagged | Comments Off

Remove Jetpack’s Open Graph meta tags

If you’ve activated the Sharing or Publicize module, Jetpack will automatically add Open Graph meta tags to each one of your posts. These tags are used by Facebook to gather information about the post and build a post preview when one of your readers shares a post on Facebook.

If you already use another plugin to handle Open Graph meta tags on your site, we’ll automatically deactivate Jetpack’s Open Graph meta tags for you, to avoid any duplicates.

If, however, you’ve added these tags to your theme or built your own plugin, you’ll want to add the following code to your theme’s functions.php file or to your plugin, to deactivate Jetpack’s Open Graph meta tags:

add_filter( 'jetpack_enable_open_graph', '__return_false' );
Posted in Code snippets, Tips & Tricks | Tagged , , , | Comments Off

Changes to the Twitter Widget

Screen Shot 2013-04-30 at 11.25.38 AMIn Jetpack 2.2.3, released on April 26th, 2013, we introduced a new widget called the “Twitter Timeline” widget. This widget allows you to display your tweets on your blog in a much richer way then you could with the old Twitter widget. Users can retweet, favorite, and reply to you straight from your blog. The experience is also much closer to the experience of Twitter.com.

The old Twitter widget — which shipped with versions of Jetpack below 2.2.3 — will stop functioning on May 7th. This is because of some changes Twitter is making with how developers communicate with their service. Our new widget uses their timeline product which allows us to offer a solution that will continue working while providing additional features.

The old widget will gracefully stop returning output after May 7th. Any admins on your blog will receive a message asking them to switch to the new widget.

Let us know if you have any questions or what you think of the new widget in the comments below!

Posted in Misc | 17 Comments

Jetpack 2.2.5

Dear Jetpack Community,

Today we released Jetpack 2.2.5. This is a minor release with a few small bug fixes:

  • Stats enhancement: counting of registered users’ views can now be enabled for specific roles
  • Security tightening for metadata support in the REST API
  • Minor update to the Twitter Timeline widget for future compatibility
  • Custom CSS: prevent a possible PHP warning, and allow the content width setting to be larger than the theme’s content width

You should update immediately via the one-click update prompt in your dashboard.

You can read the full changelog here. As always, please get in touch with us if you run into an issue. We’d be very happy to help!

Posted in Releases | 17 Comments

How to remove the comment form from Carousel View

Sometimes, you may not want your readers to comment on single images. If that’s the case, you can deactivate comments on all attachment pages and in the Carousel view by adding this code snippet to your theme’s functions.php file:

function tweakjp_rm_comments_att( $open, $post_id ) {
    $post = get_post( $post_id );
    if( $post->post_type == 'attachment' ) {
        return false;
    }
    return $open;
}
add_filter( 'comments_open', 'tweakjp_rm_comments_att', 10 , 2 );
Posted in Code snippets, Tips & Tricks | Tagged | Comments Off

Custom post type and metadata support in the REST API

Originally posted on Developer Resources:

We’ve recently made some updates to the REST API which is available here on WordPress.com and for any Jetpack-enabled site that have the REST API module activated. The API now has full read and write support for custom post types and post metadata.

You can specify a post’s post type when you create or edit it. If you’re fetching a single post, you will receive it’s post type in the response. Of course, you can also specify a post type when fetching a series of posts. In all cases the parameter to use or look out for is type.

You can also query posts by metadata using the new meta_key and meta_value parameters. You can add, update, delete or retrieve a post’s metadata when creating, editing or getting a single post, using the new metadata parameter which accepts an array of metadata keys, ids,

View original 388 more words

Posted in Uncategorized | Comments Off

Urgent Bug Fix: Jetpack 2.2.4

Dear Jetpack community,

I want to apologize, firstly, for pushing multiple updates out to you in one day. We’ve been doing our very best over the last several months to make sure that our releases are stable and tested in as many disparate environments as possible.

In this case, a bug cropped up because of an oversight in how we loaded a compatibility file for bbPress in Jetpack. It wasn’t caught in testing, which is unfortunate. This is a good example, though, of how we learn from our mistakes, improve our processes, and do better with the next release.

For those users effected by this, we decided it would be better to release Jetpack 2.2.4 as soon as possible to resolve this issue.

As always, please get in touch with us if you run into an issue. We’d be very happy to help!

Posted in Uncategorized | 8 Comments
Follow

Get every new post delivered to your Inbox.

Join 61,531 other followers