I am setting up a new WordPress blog and would like to include a widget in the content of a Page. I found some forums describing PHP hacks which appeared to apply to older versions. With WordPress 3.0.1 what is the best way to include a widget in a page?
Leave a Reply
You must be logged in to post a comment.
This plugin might be the easy way. http://wordpress.org/extend/plugins/add-widgets-to-page/
But for a scratch method…
Look into Theme Twenty-Ten’s functions.php file and find where the dynamic sidebars are registered. It looks like this:
I’ve written in Area 7 above, as Twenty-Ten includes 6 widgetized areas. Copy all this into your theme’s functions.php if it isn’t there already, and delete or add what you need.
Use the following function call in your template file where you want to place your custom area 7:
For example, create a template file in your theme directory, and use it as the default template for a page you create in WordPress. Go to Appearance->Widgets and drag widgets to your area 7 and they will appear on your page. If you need another widget area (dynamic sidebar), substitute the 7 for an 8>
This answer was created with the help of this post by a guy named Flynn
I’ve published a plugin called Widgets on Pages which allows easy definition and inline inclusion of widgets inside posts and pages. I think this would be of help