• Does anyone know if there’s a plugin that enables you to point to a site directory/folder and convert the content into a list of clickable links?

    Sounds nuts… but here’s why I’m asking…

    I have folder on the server inside of the theme directory called manuals. I uploaded over 100 product manuals (PDF format) into this directory. I’m looking for a way to create a page that lists the contents of the directory and converts them into links. When manuals are added/deleted/updated… the page would simply reflect these changes automatically.

    I don’t want to manage all of these assets individually.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Rule13

    (@rule13)

    Maybe this could be accomplished through a shortcode?

    Thread Starter Rule13

    (@rule13)

    I figured this out… but I totally forgot/overlooked the fact that I need the stupid title of the file in order to do what I want… not just the filename. Duh@!#!@#

    In case anyone needs/wants to list the contents of a directory… here’s the code I used. I threw this into a template file and it worked great.

    <?php
     //path to directory to scan
    $theme_name = get_template();
    $manual_directory = "wp-content/themes/" . $theme_name . "/library/manuals/";
    
    //get all files with a .pdf extension
    $manuals = glob($manual_directory . "*.pdf");
    
    //print each manual file name
    foreach($manuals as $manual)
    {
    //wrap this in an href <a href='$manual' target='_blank'>$manual</a><br>
    echo "$manual<br>";
    }
     ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Directory Viewer’ is closed to new replies.