frescova
Member
Posted 2 years ago #
I need to create a list of media items associated with a page.
Basically I have a page that will be updated regularly by simply uploading wor/pdf/ppt files (meeting minutes, handouts, etc.) - I want to automatically create a list of all of these files so that all my editor needs to do when editing the page is just upload the media item.
I've looked everywhere and can;t find a solution, any ideas?
Thanks in advance...
ascott12
Member
Posted 2 years ago #
I am looking for the same thing - just so I can upload pdfs and a list is automatically generated. Soemthing similar to List category posts except for media would be good
ascott12
Member
Posted 2 years ago #
Ok I've done it. Now i just need to read up on how to convert it into a plugin. Basically i just wrote a function in php code to do it and then use another plugin atm to allow php to run on a page!
When i get some time I will convert to a plugin for all to use -->hopefully next week.
freddieblicher
Member
Posted 2 years ago #
ascott12 - Have you already created the plugin? I'd really like to try it out.
danielsun
Member
Posted 2 years ago #
When in loop in the page.php, use this function:
$images =& get_children('post_type=attachment&post_parent='. $post->ID )
It will give you array of all media attached to the post/page. Note that only media that have been uploaded in the popup at specific page will show up (not all media from media library).
frescova
Member
Posted 2 years ago #
Thanks @danielsun - still looking for a solution cateogrize and list all media from media library...
a "list attached pdf" widget is exactly what I am searching for... I have to believe someone has created this exact thing. I will post anything I find here... please do the same! -HamburBaden
Ok, so there was not a widget that did this... until now, that is. Introducing the wee widget-of-the-day: List Related Attachments. This widget will list all related attachments, filtered for images, ms word files, pdf files, etc. It just hacked it together and it works for me. If you have any questions, or need any further functionality, just leave me a comment on the plugin page.
Enjoy!
Update: Version 1.1 of the List Related Attachments widget for WordPress
Update: List Related Attachments widget is now also hosted in the wordpress plugin repository. That is all.