WordPress Media Library – Beginner Question!

[ad_1]

Hi All,

I’m looking for some advice please…

I’m learning JavaScript at the moment have been adding the little projects I work on as I learn to my WordPress site. I’ve been working on a simple little game which essentially involves a lot of images and I’ve got it to work on my laptop, but when I tried to transfer the code to WordPress, the images don’t appear so the game now doesn’t work.

I’ve uploaded all of the images to the media library, swapped out the image src in my script section to be the links of the images in the media library and also checked my syntax but still can’t get it to work. The videos and articles I’ve read about this say that I need to use the URL from the images in the media library, but is there something special I need to do when adding the image links that I’m missing please?

For reference, the code is basic (I am a beginner!) and reads like this when on my laptop (images are on my desktop) …

const cardArray = \[

{

name: “image1”,

img: “image1.jpg”,

}

\]

Any advice will be greatly appreciated!

​

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer