Migration to WP - Couldn't load image
Situation:
I'm trying to migrate static page made with HTML/CSS/JS into Wordpress. The images won't load. They work in HTML, but when I migrate into PHP there are only alt-descriptions visible. Upon examining it in the Mozilla Dev Tools, there is a correct link to the image that displays the image upon clicking. However, on the migrated WP site there's an error Couldn't load image. Directory seems correct, but image just won't load.
What I tried.
- get_theme_file_uri()
img src=?php echo get_theme_file_uri('/img/landing/landing__cat-headphones--fb.png') ? class=d-block mx-lg-auto img-fluid landing__cat-headphones--img alt=lingcat-headphones loading=lazy
This one gets me a working link in the dev tools that I can click and it opens the image correctly. However on the page only alt-desc appears and dev tools displays Couldn't load image.
- get_template_directory_uri()
img src=?php echo esc_url( get_template_directory_uri() . '//img/landing/landing__cat-headphones--fb.png' ); ? class=d-block mx-lg-auto img-fluid landing__cat-headphones--img alt=lingcat-headphones loading=lazy
This one does pretty much the same thing like the method above.
- Uploading the image into Media library and pasting the code to the src
img src=http://localhost/wp-content/uploads/2022/05/landing__cat-headphones-fb.png class=d-block mx-lg-auto img-fluid landing__cat-headphones--img alt=lingcat-headphones loading=lazy
Again, the same thing. I can access the image via dev tools, so I'd assume the dir is correct, but WP just won't display the image.
What else could I do?