Treehouse: Grow your CSS skills. Land your dream job.

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

  • # May 25, 2011 at 1:28 am

    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?

    # May 25, 2011 at 2:16 am

    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.

    # May 25, 2011 at 4:25 am

    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….

    # May 25, 2011 at 10:09 am

    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!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.