treehouse : what would you like to learn today?
Web Design Web Development iOS Development

WordPress: Creating a drop-down menu of .pdf files

  • Is there a way, in WordPress, to build a drop-down menu for all available .pdf files uploaded to the Media Library? I use the Document Links widget to create sidebar lists of .pdf's, but my client would like a dropdown menu of said files as part of a horizontal top nav bar. You'd hover over "Forms", for example, and a list of all available .pdf's would drop down. Not sure how to run a loop for .pdf's. Any ideas?
  • Hmmmm... you could run a loop for attachments. Create a page called PDFs, hide that page from navigation, attach all of your PDFs to that page, and run a loop through all attachments on that page.

    That seems more complicated than it needs to be, there might be something more simple. Some sort of plugin.
  • Couldn't you just get the URL of all the forms and manually link to them? I think although a dynamic solution would be nice, you'll probably spend more time doing that then it'd have taken you to just add them manually to a drop down....
  • Doc -- I thought the same thing: there must be some sort of plugin available; just haven't found it yet. I'll definitely keep your solution in mind if I can't find anything (and probably pick your brain for specifics on how to build that particular loop as well :).

    Brightonmike: I thought about doing that, but the client will be adding to the list as time goes on, and I don't want to have to manually add links each time (or trust the client to do so! :)

    Thanks to both for your help!