Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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)?

share|improve this question

3 Answers

You can skip sidebar step, by using the_widget() function in template to display instance of widget you need.

share|improve this answer

I've tried a dirty solution for this and it worked for me - drag the widget in the sidebar, use firebug or other method to copy the what is between and put it wherever you want. You can then apply custom styles.

I am not sure though how long this solution would work though, as the Jetpack updates may change the form code, making the previous code unusable, so you would have to check and update occasionally (if necessary).

share|improve this answer

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)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.