Viewing 2 replies - 1 through 2 (of 2 total)
  • the code utilizes wp_upload_dir() (which is called in line 52: $baseDir = wp_upload_dir();) which changes with the year/month, unless you uncheck the uploads_use_yearmonth_folders setting in the administration panel (which I read on dev.wp, but have no idea if its true or not)

    while i have only just installed this plug in today, i faced the same issue as you as i wanted to read from a folder (memos; which in itself contains subfolders divided into years) in wp-content/uploads, and not in the year/month folders.

    be warned.. do this at your own risk..
    comment out line 53/54

            
    //$dir = $baseDir['path'] . '/' . $folder;
    //$outputDir = $baseDir['url'] . '/' . $folder; //ex. https://example.com/wp-content/uploads/2010/05/../../cats' 
    

    in it’s place,

    
    $dir = $folder;
    $url = home_url();
    $outputDir = $url . '/' . $folder;
    

    if my understanding is correct, I am no longer using the default upload directory (wp_upload_dir).

    Original $dir appends the directory you are pointing to, to the wp default upload directory.
    $outputDir also uses the same default folder, so in it’s place, I have set it to read from the url + directory being pointed to ..

    in your case, your shortcode would be
    [MMFileList folder= "wp-content/uploads/2018/01/documentation/" ...

    again, i must reiterate this, as I have not fully read thru the entire code..
    DO AT YOUR OWN RISK..

    • This reply was modified 6 years, 6 months ago by canonite.
    • This reply was modified 6 years, 6 months ago by canonite.

    Additionally, after reading the description page of the plug in ..

    Usage Examples:

    Let’s say you’re using the default WordPress Media settings so we can expect your uploads folder to be in /wp-content/uploads/mm/yy/ with this in mind the shortcode “folder” attribute will look in a directory relative to this. With this base directory say we want to list “png” files in the folder “/wp-content/uploads/cats/” we would use the following shortcode:

    [MMFileList folder=”/../../cats/” format=”table” types=”png” /]

    If you have you disabled the setting to store uploads in the /mm/yy/ folder structure (you can do this within Settings -> Media) and wanted to display that same file you would use this shortcode:

    [MMFileList folder=”/cats/” format=”table” types=”png” /]

    This will result in a tabular list of all .png files in the /wp-content/uploads/cats/ folder.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Folder path’ is closed to new replies.