mercredi 16 septembre 2020

Display Random Image from WP Directory

I have used a function (from this tutorial, if needed for reference https://wp-time.com/get-random-image-from-folder-in-php/) to pull a random image from a specific wordpress directory. I can successfully call up a random image however it does not display, just displays instead the image filename and a broken image icon.

The code I am using from the tutorial to display the image is <?php echo Qassim_Random_File("my-folder-name"); // display random image! ?>

I am brand new to php as of this week, and a fairly novice coder in general (know some basics) so I really am stumped. I've fooled with other possible solutions from stack overflow already but this tutorial is the only thing I've been able to get close to working. Many thanks if anyone can spot the problem!




Aucun commentaire:

Enregistrer un commentaire