• Please support development of this plugin by making a donation.



Media Widget

Description

Provides a sidebar widget to generate a linked list of media tagged using the Media-Tags plugin by Paul Menard.

Installation

  1. Download the plugin and unzip
  2. Copy the plugin folder to your ‘/wp-content/plugins/’ directory
  3. Activate the plugin
  4. Drag an instance of the Media Widget into the sidebar
  5. Select the title, tag id, and number of items to display (leave blank for all items)

How can I help support this plugin?

A donation to support this plugin would be greatly appreciated. I also appreciate a rating on the WordPress plugin directory.


Changelog

May 13, 2010
  • Remove PHP_EOL since it is not supported on all servers
  • Handle case when no media found
  • Fix minor lint error

0.1 March 29, 2010

  • Initial release

13 Responses to “Media Widget”

  1. Frannie says:

    Hi there!

    Thanks for developing a tool to publish a list of some media files. I tried to use it on my brand new wordpress site but must be doing something wrong, since nothing happens. This is my story: I am writing a blog about my biggest hobby: cooking. Of course from time to time I add pdfs with recipes. I’d love to have a list of these in the sidebar, and tagged all the PDFs with ‘Recipe’. When I activate your plugin a choose this tag, nothing shows, though. Can you help me resolve it, since I cannot find any other plugin that seems to be enabling me to do this.

    Thanks!
    Frannie

    • Bev says:

      Hi Frannie. It looks like the plugin is not finding any matches for the media tag. It uses the function “get_attachments_by_media_tags” to find the items, and then lists them. It seems to be finding no matches. Maybe you could trying inserting the shortcode [media-tags media_tags="Recipe"] on a test page to see if it finds anything.

  2. Frannie says:

    Hi Bev,

    Thanx for responding so quickly. I have been trying to see what you mean, but I am not sure. Do you mean for me to change the html code of your plugin by adding the words, or something else? I tried the first thing, but it resulted in a fatal error. Please help me again… ;-)

    Frannie

    • Bev says:

      Frannie – shortcodes are entered as plain text inside a WordPress page. So just create a new page, enter the exact text [media-tags media_tags="Recipe"] and see if it finds any matches.

  3. Frannie says:

    Hi Bev, thanks for explaining. It doesn’t seem to work, though. :-( Unless you have another possible solution (which I hope) I will start looking for a different widget.

    • Bev says:

      If the shortcode doesn’t work either then there is a problem with your tagging. There might be a conflict with another plugin or you might have a slight spelling mistake in your tag names.

  4. fabrice says:

    hello,
    is there to order the list ? is that possible to add a field to the media so that i can order the list on it ?
    Thanks,
    See you,
    Fabrice

    • Bev says:

      Hi fabrice. This plugin will order the media by descending date. If you would like another order it is quite simple to edit the media_widget.php file and find the line:

      $media_list = get_attachments_by_media_tags("media_tags=$tag&orderby=date&order=DESC");

      You can change the values to whatever is currently supported by the Media Tags plugin.

      Hope this helps.

  5. Hugh says:

    Hi Bev,

    First off, thanks for such a cool widget.

    Secondly, I’m trying to list all media tagged with “x” on a page. These are DOC and PDF files. Using the following shortcode — [media-tags media_tags="x"] — produces a dot-point list with non-existant images and no words: http://hughhh.com/hosted/ss.png

    Any pointers? I’m just after a text listing of links to download the media.

    Thanks!
    -Hugh

    • Hugh says:

      Sorry, I should have included the resultant page’s source (tag brackets have been replaced with “[" and "]“):

      [ul][li class="media-tag-list" id="media-tag-item-793"][img
      src="" width="" height=""
      title="Quarantine petition - August 2011" /][/li][li class="media-tag-list" id="media-tag-item-807"][img
      src="" width="" height=""
      title="National Finch Census 2011 – An Analysis" /][/li][/ul]

      Hopefully those tags are visible…

      Thanks again!
      -Hugh

    • Bev says:

      Hi Hugh,

      You need to use the widget rather than the shortcode. The shortcode provides a way to confirm that the correct items are being found, but the plugin is designed specifically for use as a widget. You should then see a bulleted list with titles.

  6. Juan Angel says:

    Hi Bev,

    Great widget. I just need to tweak it in order to list ALL the media tags used, not only the one selected on the widget edit section. Is there a way to display a pop-down menu or something similar where “no media selected” appears? Or a simple list. Anything would help.

    Thank you for your time.

    • Bev says:

      I don’t know how many media items you have, but you could add an additional media tag to all the media items and use that in the widget.

Leave a Reply

*