Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Alternatively, you can also set the style in the html document in the head
<html>
<head>
(...)
<style>
body {
background-image: url(<?php bloginfo('template_url'); ?>/images/bg.jpg);
}
</style>
</head>
<body> (...) </body>
</html>
Hello!
<?php bloginfo('template_url'); ?> would most likely work if the images were not rendered in css. Check if the path to the image is displayed correctly.
Otherwise, you can display the image by specifying a relative path starting from wp-content/uploads
I don’t understand what the img folder is and where exactly it is located ... but as I understand it, you changed the media upload root directory from uploads to img?
PS do not need to specify an absolute path, because if in the future you connect an SSL certificate, you will need to change http --> https everywhere
If in the .php file you need to write something like this:
<style>
body {background-image: url(<?php echo get_template_directory_uri(); ?>/images/bg.jpg);}
</style>
body {
background-image: url("../images/bg.jpg");
}
body {
background: url("../images/bg.jpg") no-repeat center;
background-size: cover;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question