简体   繁体   中英

Custom wp-content/upload image page

I've been looking for a way to make a custom direct access images on wp-content uploads folder since a year ago, but I still didn't found how to serve / display image in wp-content/uploads folder using custom script (maybe php)

Please take a look at my screensshot here : http://prntscr.com/30sdb8 you can see this wp-content/uploads are still have some additional code, and even this page source are hidden with an image (the same image) is there anyone know how to do that on a worpdress website?

Thanks for answering my question

Updated

because of some unclearly information in my previous question here I try to explain as clear as I can.

In a default wordpress website if a user direct access an image from wp-content/uploads/ directory (for an example : www.domain.tld/wp-content/uploads/2014/04/image-name.jpg ) there will be only an image and a blank background, but in my screenshot example you can see that there are some additional code in header and footer. my question is how to make modification like that in wordpress? so I can display a header and of footer on my wp-content/uploads/ Url pages

ps : the website I mean is lincah.com , you can go to google image, site:lincah.com then click on 1 image on the search result you'll be brought to the page I mean.

I hope thats clearly enough.

Thank you

What I could make out is you need a PHP script that could fetch all the images from uploads folder and display on the page.

<?php
    $images_list = glob("wp-content/uploads/" . "*");

    foreach($images_list as $image) {
       echo '<img src="' . $image . '" /> <br />';
    }
?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM