How To Insert Any Widget Into Your LearnDash Course Content

By: Justin Ferriman • April 14, 2015
Filed Under:

When creating an online course using LearnDash, the default layout includes a sidebar on the course, lesson, topic, and quiz pages.

As mentioned in a previous article, this is a useful layout as it allows you to display course progress, navigation, and any other custom information so as to enrich the online course experience for your learners (these items are called “widgets” in WordPress).

But what if you don’t want to use a sidebar for your courses? Will you lose your ability to use LearnDash (and theme specific) widgets?

Absolutely not! 🙂

The sidebar layout certainly has its uses, but you aren’t restricted to it. You can choose to use another page layout and still have the ability to use any widget you wish by inserting it directly into your course content.

Turn Widgets Into Shortcodes

If you’re new to WordPress, a shortcode is simply a small bit of text that you insert into any page or post on your site to display a specific item or perform certain functionality.

For example, in LearnDash there is a profile shortcode: [ld_profile]

When that is put on a WordPress page, it results in a front-end user profile for LearnDash users.

Using the AMR Shortcode Any Widget plugin, you can quickly create shortcodes for any widget available on your site, and then insert this shortcode into your LearnDash course content.

For example, let’s say you want to take the Course Navigation Widget from LearnDash and put it on a lesson. After installing and activating the AMR Shortcode any Widget plugin, you first navigate to APPEARANCE > WIDGETS.

You will notice a new section for your widgets. Here is where you can configure the settings of your new shortcode. Since we are using the Course Navigation widget in LearnDash, we drag that widget to this section.

[frame type=”paper-stack”]

[/frame]

Next, navigate to the lesson where you want to use your shortcode and insert the following:

[do_widget_area]

That’s it! When you view your lesson, you’ll see the course navigation widget on the lesson content area instead of in the sidebar, as shown here:

[frame type=”paper-stack”]

[/frame]

This is just one of the many options available for this particular plugin. For more shortcode options, go to SETTINGS > SHORTCODE ANY WIDGET.

The great thing about this functionality is that you can use it for any widget on your site, not just LearnDash widgets. For example, if you have a theme with unique widgets, then you can turn those into shortcodes as well and insert them into any page or post!

The AMR Shortcode Any Widget plugin is available for free on WordPress.org.

Justin Ferriman

Justin started LearnDash, the WordPress LMS trusted by Fortune 500 companies, major universities, training organizations, and entrepreneurs worldwide. He is currently founder & CEO of GapScout. Justin’s Homepage | GapScout | Twitter