开发者 |
escapecreative
davewarfel |
---|---|
更新时间 | 2022年1月24日 13:05 |
捐献地址: | 去捐款 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 5.9 |
版权: | GPLv3 |
版权网址: | 版权信息 |
<iframe>
or write your own code.ldx-widget-area
class.
.ldx-widget-area.fm-nav-before
.ldx-widget-area.fm-nav-after
.ldx-widget-area.fm-content-start
.ldx-widget-area.fm-content-bottom
.ldx-widget-area.course-content-start
.ldx-widget-area.course-content-end
.ldx-widget-area.group-content-start
.ldx-widget-area.group-content-end
.ldx-widget-area.fm-nav-before { margin: 1em; }
This would add 1em of spacing around the widget area that appears above the navigation in the Focus Mode sidebar.
In addition, all widgets placed inside of a widget area have a class of .ldx-widget
.
Show/Hide Widgets on Certain Devices
https://www.youtube.com/watch?v=X-5I_JqB3NU
While not a direct feature of this plugin, you can show/hide widgets on different devices using another free plugin.
is_single()
conditional tag to only display that widget on a specific page7
:
is_single( '7' )
If you wanted to display a widget on multiple pages (with IDs of 1, 2 and 3), your code would look like this:
is_single( array( 1, 2, 3 ) )
There are many more WordPress conditional tags you can use.
There are two ways you can add widgets to the new widget areas that this plugin creates.
+
icon or use the /
key to choose a block or widget+
icon or use the /
key to choose a block or widgetYes. Widget Areas for LearnDash should work with almost all themes. We use standard LearnDash action hooks, so as long as your theme is not modifying this LearnDash code (they shouldn't be), then it should work. You might experience some spacing irregularities, depending on how your theme styles its default widgets. Please reach out in the support forum so we can help you adjust spacing. Incompatible Themes:
If you're already using the Design Upgrade for LearnDash plugin (free or pro), the spacing is automatically added for you. Not only does it add spacing, but it upgrades many other aspects of the LearnDash design.
If you'd like to write your own CSS, add the following code to the style.css
file of your child theme, or the "Additional CSS" area in the Customizer.
.ldx-widget-area.fm-nav-before, .ldx-widget-area.fm-nav-after { margin: 1em; }
This will add 1em
of margin around the widget areas in the Focus Mode sidebar. Feel free to adjust the value to achieve the spacing you want.
Sure thing. Add the following code to the style.css
file of your child theme, or the "Additional CSS" area in the Customizer. You'll need to adjust it for the specific widget area you'd like to target (see class names in description above).
.ldx-widget-area.fm-content-start { padding: 0.75em; border-radius: 5px; background: #000; color: #fff; }
This would change the Focus Mode: Content: Start widget area to have a black background and white text. The padding is there so the text doesn't run up against the edge of the box. Feel free to adjust the border-radius
to match your site's style, or just delete it.
That's probably because we haven't added it. There are 50+ different areas we could've added widgets to, but that would clutter your WordPress admin area, and we didn't want to do that to you. We carefully selected the areas we thought course creators would want most. However, it's possible we got this wrong. If there's enough demand for a particular widget area, and LearnDash allows us to target it, we'll consider adding it.