How can I show the Jetpack Subscriptions form in a page? [closed]

In the Jetpack plugin, the subscriptions module can be included in your blog by following these instructions:

To use the Subscriptions widget, go to Appearance → Widgets. Drag the
widget labeled “Blog Subscriptions (Jetpack)” into one of your
sidebars and configure away.

I am interested in including the subscriptions form on a Page within my site, in the main section of the page. Is there some sort of shortcode or other way that I can easily include the subscriptions form within my page content? Or to do this, would I need to define a new sidebar, put the subscriptions widget in the sidebar, and them make a custom template that includes this new sidebar within this page (quite a cumbersome exercise)?

3 Answers
3

Right Now jetpack provides only way to embed subscriptions as sidebar widget. Registering a new sidebar would be a better Idea to do so, and this will not take more than few seconds.

Step 1 – Register a sidebar for jetpack

Just drop in this code somewhere in your theme’s functions.php file.

register_sidebar( array(
    'name' => 'JetPack in page',
    'id' => 'jetpack-in-page',
    'before_widget' => '<div id="jetpack">',
    'after_widget' => '</div>',
    'before_title' => '<h3>',
    'after_title' => '</h3>'
) );

Step 2 – Where you want the form to appear ?

Now place the following code where you want the form. Anywhere in the theme, You can put this code just bellow the <?php the_content(); ?> So it will show just bellow your page / post content.

<?php dynamic_sidebar( 'jetpack-in-page' ); ?>

Step 3 – Your done !

Now drag and drop the widget into JetPack in page sidebar and the form will be shown in the page. However the widget is specially made for sidebars so you might need to do some Styling to make it look nicer on full page.

Reference – register_sidebar(); (WordPress Codex)

Leave a Comment