How To Insert Any Widget Into Your LearnDash Course Content

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.

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:

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.

Categories

About the Author:

Justin Ferriman is the co-founder and CEO of LearnDash, the WordPress LMS trusted by the world's leading organizations, such as the University of Michigan, Digital Marketer, WPEngine, and Infusionsoft. Justin has made a career as an elearning consultant where he has implemented large-scale training programs for Fortune 500 companies. Twitter | LinkedIn

4 Comments
  1. UT

    How did you know to add “Area” in the shortcode name? I thought the name has to folllow the name of the widget which in this case would be “course navigation”…I ask so I know how to apply this to other widgets. Thanks and cool concept!

  2. Taylor

    Hi Justin,

    This is very helpful – however I’m having trouble adding the Course Navigation widget to a WordPress Page.

    Is there anyway I can do this? So for instance, adding it to the users profile page.

    Thanks,
    Taylor

    • Hi Taylor-

      The course nav and progress widgets will only appear on LearnDash pages. This is because these widgets always reflect the status of the course being viewed and regular pages/posts don’t have this kind of data.

0 Pings & Trackbacks

Leave a Reply

86 Reasons To Choose LearnDash ... Show Me →
+ +