How to Insert a Widget into a WordPress Post or Page 3


If you know what WordPress shortcodes are, then chances are you know how useful they can be.  A lot of WordPress plugins come with shortcodes built in, meaning you can insert them into your web page, anywhere you like.  An example would be to insert a widget into the body of a WordPress post.  However, not all plugins have shortcodes.  In this case, you can use a simple WordPress plugin which allows you to create a shortcode for any widget.  The following video shows how I take a WordPress plugin without shortcode functionality and create a shortcode for it, then insert it into a WordPress page.

Resources:

AMR Shortcode Any Widget plugin – the plugin that allows you to create a shortcode for any widget.

Example

Here is a the 300×250 pixel version of that widget inserted into this post:


Widget not in any sidebars
Note that to align the widget in the center (or to the right), switch over to the “text” tab of the editor, and wrap the shortcode in a <div> tag and set the align property, like this:
align center
Like this tutorial?  Have comments?  Please leave them below…  Thanks!

Leave a comment

Your email address will not be published. Required fields are marked *

3 thoughts on “How to Insert a Widget into a WordPress Post or Page

  • Andrzej Rodziewicz

    Hi Andy,

    I have been using this plugin for some months now and can confirm it works very well. It is refreshing to see that the developer updates the plugin to keep up with WordPress versions.

    The problem I found, was that the widgets I installed in the body text inherited the sidebar css styles I had added to my child theme styles.css file. This looked odd and I wanted a more natural integration.

    I found I could override these styles within styles.css by adding modified on-page css using the Simple Custom CSS Plugin. I think a more streamlined solution might be to target the widget with the new code directly from within the child theme styles.css. As a quick fix though, this does work.

    Here is an example page (sidebar styling stripped out) using AMR Shortcode Any Widget Plugin

    http://www.wimbledonvisitor.com/info/amr-widget/

    Many thanks for your very informative newsletters.
    Andrzej

  • marke

    Hello Andy,

    Thanks for the tutorial. Very clear. The one thing I’d like to know is how to *center* the shortcode so the widget is centered on the page. Using the “align” format in the text editor doesn’t work for me. Thanks again!