Embed a document inline on a page Pro
Embed one document as an always-visible inline viewer with the [filedeck_embed] shortcode or block — PDFs, Office files, images, audio and video.
The preview lightbox opens a document in an overlay when a visitor clicks a button. Sometimes you want the document to be always visible in the page instead — a datasheet on a product page, a menu, a report embedded directly in your content. FileDeck Pro adds an inline embed for exactly that.
FileDeck Pro — inline embedding is included in all Pro plans. See pricing
The shortcode
Embed a single document by its ID:
[filedeck_embed id="123" height="600"]
| Attribute | Default | What it does |
|---|---|---|
id |
— | The document’s ID (shown in the Documents list). Required. |
height |
600 |
Viewer height in pixels (120–4000). |
title |
off | Set title="1" to show the document title as a caption below the viewer. |
The block
In the block editor, add the FileDeck: Document Embed block. Search for the document in the block sidebar, set the height, and optionally show the title caption. The editor preview matches the front end.
Using Elementor? The same viewer is available as the FileDeck Document Embed widget — see Elementor integration.
Which file types embed
The embed reuses FileDeck’s preview engine, so it supports the same types:
- PDFs — rendered by the browser’s built-in PDF viewer.
- Images — shown directly.
- Office documents (Word, Excel, PowerPoint) — displayed with the Microsoft Office online viewer.
- Audio and video — played with an inline player.
A file type that cannot be previewed in the browser (an archive, for example) falls back to a normal download button, so a visitor is never shown a broken viewer.
Access and protected files
The embed honours the same access rules as every other FileDeck surface. A visitor who is not allowed to view a document sees a padlock instead of the viewer, and protected files are served through the same signed, short-lived URL mechanism used for downloads — permission is checked on every request.
Because an inline viewer is loaded as soon as the page opens, embedding is best suited to documents you are happy to show any visitor who can reach the page. For anything gated, the preview lightbox or a normal library layout with access control is usually the better fit.
FAQ
How do I find a document’s ID?
Open Documents in wp-admin and hover a document — the ID appears in the row, and in the URL when you edit it. The block’s search picker sets the ID for you.
Can I embed several documents on one page?
Yes — add as many [filedeck_embed] shortcodes or Document Embed blocks as you like. For a browsable set of documents, use a library layout instead.
Still stuck? Email support@getfiledeck.com.