zeitgrund blog

Plugin Link Uploaded Files (engl.) 0.2.1

Mittwoch, 12. September 2007 um 23:30 Uhr in Link Uploaded Files, Plugins

Download the latest release (0.2.1) of the plugin
Link Uploaded Files

For German Description click here / zur Deutschen Beschreibung

When writing a new post, WordPress provides the feature to upload files and embed them to the post. But you have to embed every file separately.
And you don’t have special functions, like giving the file links or images a certain class (for CSS styling).
Or perhaps you use the the_excerpt(); function which has the attribute not to show pictures or links.
Another need might be the possibility to link the uploaded files without showing the post (maybe for a special archive e.g.).

To solve these problems you can use this plugin.
The plugin call can be put anywhere inside the loop.
And if there were uploaded items in the post, the plugin will link or respectively show them, even if they are not embedded to the post.
Just upload the files – that’s all.

Summary of functions:

  • The plugin links to all files who are uploaded by a post – you dont’ have to embed them to the post
  • Images can be linked or shown directly
  • File description is used as link text. If there is no description, the title (filename if not set) will be used
  • Links and images have the class=”attachment” – the class can be changed by parameter
  • You can prevent files from being listed by writing (to minus) anywhere in the file description
  • Special text or code can be used before and after every link item

link-uploaded-files.zip (2kb)

0.2.1: Added compatiblity for WordPress 2.3.

Download ZIP and unzip. Upload link-uploaded-files.php to your /wp-content/plugins/ directory.
Go to admin backend and activate the plugin.

Put the following code into the template files of your theme, just where you want to show the file links:

<?php zg_uploaded_files(); ?>

Remember, that the code must be inside the loop.


show_images= (Boolean)
TRUE (default) – images are shown, not linked
FALSE – images are linked

link_class= (String)
Class (class=’ ‘) of the link or image, for styling with CSS. Default isattachment.

before= (String)
Code (HTML) that is used in front of every link. There is no default.

after= (String)
Code (HTML) that is used after every link. Default is <br />.

Code examples:

<?php zg_uploaded_files('show_images=FALSE&link_class=attach-link&before=<strong>Download: </strong>'); ?>

<ul><?php zg_uploaded_files('before=<li>&after=</li>&show_images=FALSE'); ?></ul>

Kommentar verfassen

Zeilen und Absätze brechen automatisch um, E-Mail Adresse wird nicht veröffentlicht (ist aber obligatorisch), HTML erlaubt: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>