WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the Newsletter plugin (http://wordpress.org/extend/plugins/newsletter/) to compose e-mail newsletters. Using the "auto-compose" feature to pull website data via the theme included with the plugin, which I have begun to customise.

It's pulling posts just fine, which is a good start - but I would also like to pull some data that a custom widget on our site is displaying. I'm fairly new to Wordpress and the custom widget in question was not developed by me. Can I include a specific widget via my theme template?


share|improve this question
I've tried using this code, but it's not pulling anything. <?php the_widget($widget_name); ?> – Bill May 17 '11 at 14:27
up vote 0 down vote accepted

You may already know this, but you need to specify the widget's class name as the $widget_name variable in the template tag. For example,

Depending on the widget, you may also need to add parameters to the_widget() to get it to display properly — see notes on thewidget() $instance and $args in the codex. http://codex.wordpress.org/Function_Reference/the_widget

Alternatively, you can use a plugin like Widgets on Pages, which will let you include a widget anywhere using by using a shortcode like this: [widgets_on_pages id=WidgetName] http://wordpress.org/extend/plugins/widgets-on-pages/

share|improve this answer
Thanks, very helpful. – Bill May 19 '11 at 10:01

Your Answer


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.