Home > Net >  How to specify the background-image url using WordPress Customizer?
How to specify the background-image url using WordPress Customizer?

Time:06-02

Been googling but no joy. I'm using Customizer->Additional CSS to enter the below.

.spinner {
    display: inline-block;  
    min-width: 20px;
    min-height: 20px;
    margin: 0 auto;
    background-image: url( '../images/spinner.gif' );
    background-position: center;
} 

But the spinner is not appearing due to the URL issue. What would be the right URL? The file is located at site.com/wp-content/themes/mytheme/images/spinner.gif

I wonder if it's possible or must I declare it style.css?

CodePudding user response:

You can add url starting with /wp-content

.spinner {
display: inline-block;  
min-width: 20px;
min-height: 20px;
margin: 0 auto;
background-image: url( '/wp-content/uploads/2022/05/spinner.gif' );
background-position: center;
} 

CodePudding user response:

You can try this

.spinner {
  display: inline-block;  
  min-width: 20px;
  min-height: 20px;
  margin: 0 auto;
  background-image: url( '/wp-content/themes/mytheme/images/spinner.gif' );
  background-position: center;
} 
  • Related