This plugin will allow you to upload document files to your posts, pages or any other custom post types that you have in your site. You can either use shortcodes or functions to display attachments. You can upload unlimited number of files as attachments. Restrict files to be downloaded by visitors of the site.
Use this [pdf_attachment file="1"] shortcode to display uploaded document files in posts, pages or custom post types. file is (required)
Example: [pdf_attachment file="1" name="optional file name"]. Or else you can use this function in your template file. file is (required), name is (optional).
<?php echo pdf_attachment_file(1,"optional file name"); ?>. Here 1 is the document number, unlimited number of documents can be uploded to every single post.
Use [pdf_all_attachments] to display all Attachments with a single shortcode.
Shortcode Example: [pdf_all_attachments]
Display all Attachments added to a post/ page in your template using this single function <?php echo pdf_all_attachment_files(); ?>
Use This shortcode to embed document files in your post or page content [pdf_attachment_view file="1" width="400" height="500"]. file (required), width (optional), height (optional) Or else you can use this function in your template file.
<?php echo pdf_attachment_file_view(1); ?>
Setup and Usage
The setup of this plugin is very simple. In settings page you just have to select the post types where you want the file upload/ attachment functionality. A detailed explanation of how the plugin works and what can be done by this plugin are described below.
The list of document files. Unlimited files can be listed here.
The PDF document is embedded in the page content. Users can view the content of the document file without downloading it.
1. You have to select the post types where you want the document attachment options and the number of document files you want to upload per post. The selected post types will have boxes similer to the below image.
2. Number of files you want to upload for each post must be mentioned in the settings page. Suppose you have entered 5 documents in the number of documents field, then 5 boxes will appear in the post edit page. The boxes have a number attached to them, this is the file number to be used with the shortcodes.
Example: [pdf_attachment file="2"]
3. Every file can be marked as Hidden. These files will be hidden from visitors of the site. Only Logged In users will be able to download these files. For others a message will be displayed in place of the hidden files. This message can be updated from admin panel.
You can select the user types that you want to give Permission to be able download the attachment files. Only selected user types will have permission to download the attachments.
4. Unlike the free version the file download link will be generated dynamically so that users will never see the actual location of the attachment file. This will make sure your files are Secured. Although if you want you can make the attachment open in a new tab.
The list of shortcodes that can be used with the plugin. This list is also available in the plugin settings page.
Each plugin comes with an unique key. This key ensures that your plugin has a valid license. Plugin key can be used to get informations about the latest version available to download. Key has to be entered in the plugin settings section.
Files that can be uploaded are PDF, TXT, JPG, JPEG, BMP, GIF, PNG, DOC, DOCX, XLS, CSV, PPT, PPTX, ZIP
Not every file can be embedded, the supported files that can be embedded are Adobe Acrobat (PDF), Microsoft Word (DOC), Microsoft PowerPoint (PPT), Microsoft Excel (XLS)
You can check the if the file can be embedded from here https://docs.google.com/viewer.