Answer the question
In order to leave comments, you need to log in
Why is background-image not showing in wordpress?
A subdomain was created to redesign the main page of the site.
htaccess is a new base for wp, changes regarding the database have been made in config.php, the database has been duplicated from the main domain, paths have been changed from absolute to relative. Styles/scripts are included in function.php.
Background images are not loaded because it does not exit css (the path in the console for the background is css/img/pic.jpg).
code in css:
.header {
background-image: url("img/head-bg.jpg");
background-repeat: repeat-x;
height: 169px;
min-width: 1024px
}
How to connect styles correctly or what could be the problem?
option "../" - not suitable
Answer the question
In order to leave comments, you need to log in
answer
SELECT sensor_instances.*,
row_to_json((SELECT d
FROM (SELECT groups.*) d
)) AS group,
row_to_json((SELECT a
FROM (SELECT addresses.*) a
)) AS currentAddress,
(
SELECT JSON_AGG(src)
FROM (SELECT sensor_parameters.*
FROM sensor_parameters
WHERE sensor_parameters.sensortype = sensor_instances.sensortype
) src
) AS parameters
FROM sensor_instances
LEFT JOIN groups ON groups.id = sensor_instances.groupid
LEFT JOIN addresses ON sensor_instances.addressid = addresses.id
WHERE sensor_instances.id IN (439)
Hello!
Have you still not resolved this issue?
By the way, an interesting point... Please tell me where is the style.css file of your theme? note, the style.css file must be in the root of the theme and then it background-image: url("img/head-bg.jpg");
will be correct.
If you have another stylesheet that is in a subdirectory, then specify .../
VI Code
Referencing Files From a Template
When referencing other files within the same Theme, avoid hard-coded URIs and file paths. Instead of reference the URIs and file paths with bloginfo(): see Referencing Files From a Template.
Note that URIs that are used in the stylesheet are relative to the stylesheet, not the page that references the stylesheet. For example, if you include an images/ directory in your Theme, you need only specify this relative directory in the CSS, like so:
h1 {
background-image: url(images/my-background.jpg);
}
Open devtools (f12) in chrome.
Refresh the page.
Open the console tab: there should be an error message (resource not found or something like that), check the URL where the browser is trying to load the image
Or open the network tab: look at the list with "red" entries that have a 404 response. Click on it and look in the headers for the Request URL parameter
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question