If your style.css is in /wp-content/themes/themedirectory
, and your image is at /wp-content/themes/themedirectory/images/image.jpg
, then your css will be this:
background-image: url("images/image.jpg");
You can’t use php in a css file, it will not parse unless included via php (instead of with <link>
).
Related Posts:
- I have a background-image in css file but don’t show in site.how to fix this prblm. i sent screenshot. thx
- How to scale image with equal width and height without distortion?
- php syntax – how to concatenate properly – echo bloginfo(‘stylesheet_directory)
- Get different images for mobile and desktop with php, advanced custom fields without using js and ajax
- Clickable image link sends people to wrong URL
- Split site title and apply different classes
- Displaying images outside the content
- How to include different html tags in the header for different pages?
- Changing 2011 theme header image based on user dropdown
- Using Featured Image as Hero Background in Word Press
- the_author_posts_link css class
- Debugging upload problem: What part of WP does actual image-resizing?
- Conditional Statement – check if post has an attachment image
- wp enqueue style and style sheet depth
- CSS saved & enqueued, but wordpress doesn’t load css text, only file
- How do I get images (with a thumbnail preview) to show in search results?
- Is it possible to use the featured image of a page as a css background without inlining?
- How to display a value from a radio button in the options menu in wordpress
- Assign a picture URL to a page via PHP
- How should I best target dynamically served content?
- Convert all images to PNG on file upload
- Escape post image attachments added to template
- An unwanted inline style is added to my body tag
- Display post image with fancybox
- Problem adding class to body_class
- Echo URL of large version of Featured Image
- How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts
- Selectbox in admin panel function linking to CSS
- Using if/else statements with output from theme options
- How to get next image with this code from same post?
- get_children displaying images removed from the page
- Gravity form built in Captcha
- Why my image upload button is not working in wordpress widget area?
- How does wp_enqueue_scripts work?
- Display image from an external rss feed on wordpress without plugins
- Whats the proper way to use a php stylesheet in a wordpress theme? [duplicate]
- custom css for admin only
- responsive.css in the WordPress should be prioritized
- Thumbnails appear to be zoomed
- WordPress function when file is uploaded, deleted or edited
- height should be set to auto to avoid pixelation in the post thumbnail function
- Odd / Even posts add class minus first post
- Download images from media library to computer in BULK?
- Three Questions with Twenty Eleven theme
- Add Codepen animation as Preloader to WordPress
- Reduce size of responsive title
- How to loop through all the attached images in a post, and get their url one by one
- WordPress archive page showing 404 Error [duplicate]
- Division by zero error in image.php
- Only show image from custom field when present
- Creating a mobile site by adding a new class to the body tag from functions.php
- Removing WordPress Footer -without access to PHP code?
- Upload non-featured image to image field
- Post repeated when opening in overlay, how do I solve this? [closed]
- Display an image based on field value
- Using bloginfo and divs inside a php file
- Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
- Assign Custom classes to every Excerpt
- How to make changes to style.php [closed]
- Adding a ‘style=’ bit to image_send_to_editor output
- Create Columns with Custom Walker and CSS Classes
- Background image no longer fits to screen now that project is in php files
- WordPress api post image raw data without being blank in media library
- Why would the child theme load in the Customize preview, but not on the site itself?
- echo cutom css code to WordPress page template file ? is this safe?
- WordPress loading all local images from specific directory?
- How do I stop an Image Address from loading in the Browser?
- Trying to generate a CSS file in wordpress uploads folder
- WP Website is shown in HTML
- I cannot find the wordpress.scss file that my live site is pulling from
- I have a lot of JavaScript erorrs after SSL someone can help me?
- How to add a PHP scripts into WordPress
- I got big white screen when i attach main style sheet of Html in functions.php
- Add a default style if no Featured image is selected
- Styling a specific post after hovering over it
- CSS loading as empty file in Custom Theme
- user update profile for custom code
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- How limit the width of a fixed menu-bar on scroll?
- Where to find the html for WordPress site? [closed]
- How to remove image on single product and get product to span page?
- widget: input the px value from user and use it as inline style in widget function
- How to resize an image server-side before upload?
- Show contact 7 form in popup
- How can I include a file related to blog URL? Nothing seems to work
- How Can I Center the Logo in the Navigation Menu? [closed]
- How to change the menu color
- Setting post thumbnail sizes in template file and functions.php
- HTML in PHP problem [closed]
- How to customize posts in WordPress by using HTML and CSS?
- How to create and add js and css file when server is not on my PC?
- which php or css file has generated an inline style in WordPress that overwrites my css
- Header location [closed]
- An automatic way to crop images of different sizes
- Blog listing not showing dates for every post and arrow missing off image
- Remove default Image Sizes
- Use URL query string in img src attribute
- inner-wrap div pushing custom table far down on page
- Add/alter image attribute before render
- Styling best practices for single pages/templates