How to Show Only the Last X Number of Files in a List

Occasionally I get asked how to show only the last 5 or so files in a list. There is no setting for this, but if you use the Simple File List Search extension with SFL Pro, you can accomplish this with a little work.

First, use shortcode attributes to sort the list and show only 5 files or folders per page. This example will show the last 5 items added to the list.

[[eeSFL folder="files" sortby="DATE" sortorder="Descending" paged="YES" filecount="5" ]]

Below the list you’ll see the pagination controls. Users can page to older files 5 at a time. If you don’t want this, you can hide the pagination controls using a little CSS in your theme.

#eeSFLS_paginationControls { display:none; }

That is all. Now this list will only show the 5 most recent files or folders in the list.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.