1. Document Library Pro
  2. FAQ

How to display the latest document above the library

Some Document Library Pro users like to display the latest document at the top of the library, separately from the other documents. There are several ways to do this.

Using Document Library Pro

The Document Library Pro plugin lists documents in a table or grid layout. You can use either of these to display the most recent document above your main document library. To do this, you need to create a table or grid which only contains the most recent document.

Table layout

The following shortcode will create a table with 1 row, which just lists the latest document:

[doc_library layout="table" sort_by="date" doc_limit="1" folders="false" filters="false" search_box="false" page_length="false" totals="false" reset_button="false"]

The shortcode looks complicated, but only the [doc_library layout="table" sort_by="date" doc_limit="1] section is essential. We added the other parts in order to hide other elements such as the search box, which are not applicable when only listing one document.

Grid layout

The following shortcode will create a 1-column grid which displays the latest document:

[doc_library layout="grid" grid_columns="1" sort_by="date" doc_limit="1" folders="false" filters="false" search_box="false" page_length="false" totals="false" reset_button="false"]

The shortcode looks complicated, but only the [doc_library layout="grid" grid_columns="1" sort_by="date" doc_limit="1" section is essential.

Using a slider plugin

You can display a featured latest document by using Document Library Pro alongside any WordPress slider plugin which can display custom post types for example Post Carousel & Slider or Soliloquy Slider. Documents are a custom post type, so you need to create a slider that displays the most recent document. You can then insert the slider directly above the Document Library Pro shortcode on your document library page. Either set it up as a slider which displays - for instance - the most recent 3 documents, or just create 1 slide so that it appears as a static banner rather than a slider.

If you don't want to use a plugin, then you can also use Document Library Pro to display the latest document above the

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.