Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/tkeeley/documents-loop/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Overview
Documents Loop is a WordPress plugin that automatically loops through subfolders inside a designated documents folder and displays links to PDF and JPG files. The plugin provides a simple and organized way to present your documents on your site. When a visitor clicks on any file link, it will open in a new tab.
Features
- Easy Integration: Use the
[documents_loop]shortcode to display your document listings anywhere on your site. - Subfolder Scanning: Automatically loops through all subdirectories inside the main
documentsfolder. - File Filtering: Displays only PDF and JPG files.
- Clean Styling: Includes simple CSS for a neat and organized presentation.
- External Linking: File links open in a new browser tab.
Installation
-
Upload Plugin Files:
- Download the plugin files.
- Upload the entire
documents-loopfolder to the/wp-content/plugins/directory of your WordPress installation.
-
Activate the Plugin:
- Log in to your WordPress admin dashboard.
- Go to Plugins > Installed Plugins.
- Find Documents Loop in the list and click Activate.
-
Create the Documents Folder:
- Within the plugin’s folder (i.e.,
/wp-content/plugins/documents-loop/), create a folder nameddocuments. - Inside the
documentsfolder, create subfolders and add your PDF and JPG files.
- Within the plugin’s folder (i.e.,
Usage
-
Insert the Shortcode:
- Open the post or page where you want to display the documents.
- Add the shortcode
[documents_loop]in the content editor.
-
View the Results:
- Publish or update the post/page.
- Visit the page to see the documents listed by folder, with each file linked and set to open in a new tab.
Customization
- Styling:
- The plugin includes basic inline CSS for styling. To override or add custom styles, you can:
- Use your theme’s CSS file.
- Use the WordPress Customizer (under Appearance > Customize > Additional CSS).
- The plugin includes basic inline CSS for styling. To override or add custom styles, you can:
- File Types:
- By default, only PDF and JPG files are displayed. To modify or add file types, edit the
$extensioncondition in the plugin’s code.
- By default, only PDF and JPG files are displayed. To modify or add file types, edit the
Support
If you encounter any issues or have suggestions for improvements, please feel free to contact me.
License
This plugin is released under the GPL v2 or later.