Override library markup from your theme Free

Copy a FileDeck template into your theme's filedeck/ directory to replace the markup of a library row or the empty state, without forking the plugin.

Updated September 1, 2026

When CSS is not enough and you need different markup, copy a FileDeck template into your theme instead of forking the plugin.

How it works

Create a filedeck/ directory in your theme and copy a template into it:

wp-content/themes/your-child-theme/filedeck/document-row.php

FileDeck looks in the child theme first, then the parent theme, then falls back to its own copy. There is no registration step and no setting to switch on.

The plugin’s copies live in wp-content/plugins/filedeck/templates/. Start from one of those — they are the files FileDeck itself renders, not reference copies kept beside a separate implementation, so what you copy is exactly what you are replacing.

Available templates

Template Renders
document-row.php One row of the table layout
empty-state.php The "No documents found" message

More will be added. If the fragment you need is not here yet, say so and it can be — the loader is generic.

What a template receives

document-row.php gets:

Variable What it is
$d Row data: id, title, permalink, dl_url, type, size, date_iso, cats, cat_slugs, tags, tag_slugs, can_view and more
$cols The column keys to render, in order
$args The library’s display arguments
$features Feature flags for this library
$row_class Classes contributed by FileDeck modules (favourited, seen, and so on)

Three helpers are available so you can replace some columns and keep the rest:

FileDeck_Render::cell( $d, $col, $args, $features );  // render a built-in cell
FileDeck_Render::label( $col );                       // that column's heading
FileDeck_Render::sort_value( $d, $col );              // its sort key

Things to keep

  • Escape what you output. A template is theme PHP, and what it prints is your responsibility, exactly as in any other theme template.
  • Keep data-id, data-cats and data-tags on the row. Client-side filtering, search and the select-all control read them.
  • In empty-state.php, keep the fdk-empty class and the hidden attribute. The front-end script reveals that element when a filter or a search leaves no rows; drop them and a search that misses shows a blank space with no explanation.

Access control is not in the template

Restrictions are applied before a row reaches a template: a document the visitor cannot see is filtered out of the query, or arrives with can_view false. An override cannot widen access by printing something differently, and it cannot narrow it either — so a customised row is not a place where a security rule can be lost.

When a plugin update changes a template

Your copy keeps rendering, because yours wins. That is the point, and also the catch: a fix or a new feature added to the built-in template will not reach a copy you made. The release notes call out template changes; re-copy when one affects a template you have overridden.

Still stuck? Email support@getfiledeck.com.