I am trying to migrate a website i hand coded myself and i have to make it a wordpress theme now. I'm having trouble using the different images i've used throughout the index.html, they can't be loaded -getting a 404 error on the dev tools console-.

My question is, where should i put my images and how can I succesfully retrieve them in my new theme? do i put them all in an img/ folder? or do they have to be uploaded through media?

the images range from img tags, to embedded svg objects, examples:

<img src="img/Logos-crear.png">

    <embed src="img/icons/twitter.svg">

and background images using css:

.header .header-img {
    background: url("../img/main.jpg");

use this code and rename index.html to index.php.

<img src="<?php bloginfo('template_directory'); ?>/img/Logos-crear.png">
<embed src="<?php bloginfo('template_directory'); ?>/img/icons/twitter.svg">

that should work fine.no need to change in css code.

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.