Skip to main content

8.3 Shortcode and CSS Reference

[learndash_materials_extended]

Renders the materials list of the course, lesson, topic, or quiz it is placed on. Takes no parameters. Outputs nothing on other post types or when the item has no materials.

[learndash_materials_extended]

Normally inserted into LearnDash's materials editor with the Insert shortcode button, so it renders in the Materials tab. It can also be placed in the item's main content, for example in a Shortcode block. See 5.2 The Materials Shortcode.

Output markup

<div class="ldash-materials ldash-materials-list-type-link ldash-materials-post-123">
<div class="ldash-materials-list">
<div class="ldash-materials-item">
<a href="https://example.com/wp-content/uploads/2026/08/slides.pdf" target="_blank" download>
<span class="ldash-materials-icon ldm-icon-file-pdf"></span>Lesson slides (PDF)
</a>
</div>
<!-- one .ldash-materials-item per material -->
</div>
</div>
  • ldash-materials-list-type-link or ldash-materials-list-type-button reflects the List type setting.
  • ldash-materials-post-{ID} carries the ID of the course, lesson, topic, or quiz, so you can style one item's list differently.
  • target="_blank" is present when Open in new tab is ticked.
  • With Icon position set to After, the icon span follows the title.

CSS classes

ClassElementNotes
.ldash-materialsouter wrapperDefault max-width: 400px. Override to widen the list.
.ldash-materials-list-type-link / -buttonouter wrapperPresent according to the list type.
.ldash-materials-post-{ID}outer wrapperPer-item hook.
.ldash-materials-listinner wrapper
.ldash-materials-itemone materialIn button mode this element carries the pill: background, border, and radius.
.ldash-materials-item athe linkText colour, size, and (in button mode) padding and uppercase text.
.ldash-materials-iconthe iconInline, font-size: 120%.
.ldm-icon-*the iconWhich glyph; see the icon map below.

Colours, sizes, and button geometry from Settings > Learndash Materials are printed as an inline <style id="learndash-materials-styles"> in the page head, so theme CSS that targets these classes may need higher specificity to win.

File-type icon map

The icon is chosen from the extension at the end of the link URL.

ExtensionIcon class
pdfldm-icon-file-pdf
doc docx odtldm-icon-file-word
xlr xls xlsxldm-icon-file-excel
pps ppt pptxldm-icon-file-powerpoint
bmp gif jpg jpeg pngldm-icon-file-image
zip gzldm-icon-file-archive
aif m4a mp3 wavldm-icon-file-audio
avi m4v mov mp4 mpgldm-icon-file-video
html css jsldm-icon-file-code
anything else, or no extensionldm-icon-doc-text (generic document)

Links to attachment pages and to most web pages have no file extension and therefore show the generic document icon.

Where the plugin loads assets

  • Front end: two stylesheets (learndash-materials.css, learndash-materials-icons.css) on every page, plus the inline style block; a Google Fonts stylesheet only when a font family is set. No JavaScript.
  • Admin: the item editor on course, lesson, topic, and quiz edit screens; the colour picker only on Settings > Learndash Materials.