I have a movies folder called movies located in site root/wp-content/movies/. I also have a template creates in my theme called page-movies.php. And a wordpress page called movies using the page-movies.php template.

What is the correct way to display the list of movie urls in the movies folder on the movies page.

I've used a scandir() inside of A tags to display all the urls as "site.com/movies/movietitle.mp4" but I click thr link to the movie is loads nothing just a blank white page.

Is there a correct way I should be loading the list of movie urls onto a oage from a directory?

  • Problem solved, used full url with http in the beginning to fix the issue. – Jeremy Jan 30 '19 at 20:36

If you movies are stored in /wp-content/movies/ and the URLs are site.com/movies/movietitle.mp4 then the links are pointing to the wrong place.

Change the URL's to include the wp-content path eg site.com/wp-content/movies/movietitle.mp4

Separate to your question, you could look at having your page-movies.php template load the links into a video element using javascript.

| improve this answer | |
  • Thanks Alexander. I did notice that the url is in fact not pointing to the wp-content/movies directory, youre right. So the url isbjust site.com/movies/movie.mp4. Since im on the movies page, how Can I append the wp-content/ folder before /movies folder in url. And then add the movie name to that. – Jeremy Jan 30 '19 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.