2 posts
  • 2 Years of Membership
  • Collector Level 1
gattung
says

Most of the themes I am trying require inserting each image link into the html of the portfolio page. Does anyone know of a theme that includes an auto load from folder script so if I need to load a lot of images I don’t have to write a link to each one?

Thanks!

1749 posts
  • 4 Years of Membership
  • Beta Tester
  • Collector Level 2
  • Exclusive Author
webdesignerart
says

Not so clear, First you have wordpress theme? Second see if you saying that there is folder of images and you want everytime you update images on that folder then website automatic load images from that folder then it will need a programmatic customization or custom php script that will get all files from folder and render it into your website.

2 posts
  • 2 Years of Membership
  • Collector Level 1
gattung
says

Thanks, this is a non-wp site. I was able to insert PHP code to do the job.

1749 posts
  • 4 Years of Membership
  • Beta Tester
  • Collector Level 2
  • Exclusive Author
webdesignerart
says

Then it will be a php based custom coding require to achive your goal.

63 posts
  • Author Level 5
  • Beta Tester
  • Collector Level 2
  • Exclusive Author
+1 more
PrimeThemes
says
//define ABSPATH as main dir, clone from WP function
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

//let say. your images folder is under the main dir named "images" - http://yoursite.com/images/
$img_path = ABSPATH . '/images/';
//see glob() function in php.net website to get more info
$files = glob($img_path . '*.{jpg,jpeg,png,gif,JPG,JPEG,PNG,GIF}');

if( is_array( $files ) ){
//do data process
    foreach ( $files as $f ) {
    $file_info = pathinfo( $f );
    $file_name = $file_info['filename']; //get filename without extension
    $extension = '.'. $file_info['extension'];

       echo 'http://yoursite.com/images/' . $file_name . $extension;
    }
}

just basic example, hope this help :)

good luck!

by
by
by
by
by
by