The way I see, you have 3 options:
- You can achieve that with CSS. Just target the div you want to put the background in. Target it in a way that only shows at the home of the site (check the ID and class of the body div, it usually has names like ‘home-template’ and such.
- You can achieve that with HTML. You can ‘hard-code’ the style inline, in your PHP file, like you would do in a HTML one. You can do that, if the body of the document is in a file that is not header.php.
- (recommended) You can achieve that with PHP using ‘is_front_page’ (https://developer.wordpress.org/reference/functions/is_front_page/). Just do a conditional that checks if the page is the front page. If it is, you can attach and ID to the body, or style it inline. Else, just use the regular body.
Related Posts:
- WP 4.4. responsive images browser choosing the “wrong” one
- Retina images – custom syntax for inserting images into post content
- Default Image Link Removal
- How to copy and paste a picture found on the web to wordpress easily
- Graphing libraries for WordPress [closed]
- add_image_sizes ignoring crop sizes and using proportion
- Dynamically add titles to post images if they are empty
- get_intermediate_image_sizes Get the Size Names but How Do I Get the Sizes?
- Cropping an image before inserting into a post
- custom image size with New Media Manager in wordpress 3.5
- Uploading images: ‘ø’ get replaced with ‘ø’
- SSL: How to make customizer images Protocol Relative in WordPress?
- Insert image in comment reply
- How to add qtranslate multi language support for media?
- custom image dimensions (for gallery)
- Screenshot.png not showing up
- Include photos in WordPress blog posts without uploading to Media Library
- The the post id from image id
- function to show only featured image of the posts
- Is there any action/filter hook to use when an image gets edited in the editor?
- Images will not display, when I call them up with html in wordpress, just two blank small spaces [closed]
- Force minimum image size and aspect ratio when uploading images
- Changing default img html markup but not in admin back-end?
- Add srcset and sizes to older uploads?
- Change align classes for images
- Ho to add “Create Slider” option to default “Add Media” popup?
- Images in Blog List
- Divi Theme – images not showing on front page [closed]
- Edit image results in copies of file being created
- Images in Media aren’t showing, not broken
- Fixing image names for a site being restored
- Upload Image using wp_insert_attachment and file url don’t have file extension
- Export xml use/import images from theme directory
- Custom header tiling?
- Using featured img as div background
- Why are featured images sometimes cropped, and sometimes not
- Display an icon with get_post_meta?
- Include WooCommerce 2’s prettyphoto scripts on all site pages
- Get custom thumbnail sizes [duplicate]
- Using Jetpack carousel w/o creating a gallery [closed]
- Where do I locate theme image files
- WordPress Facebook Open Graph plugin not working for 1 specific image [closed]
- How to set uploaded image as featured image wordpress
- Random background image showing on website per click/load
- Warning : tempnam() [function.tempnam]: SAFE MODE Restriction in effect
- How to force WordPress to upscale images?
- How to stop WordPress from completely overriding my tags in my templates?
- Image text wrap not working properly on frontend
- WordPress cutting images size
- How can i add a section of category image upload during adding of category in wp admin area?
- Errors and warning with padlock sign when site moved to SSL
- How to test if there are no more previous or next image on attachment page?
- Force square image crop during upload?
- Emoticons not working on my site
- How to use getimagesize() of image upload?
- problem with add_size_image
- photo gallery implementation like tmz
- Graphics and Formatting Not Loading in WordPress on IIS
- How to Automatically import external images to Upload
- Edit Page did not get refresh after update
- get_post_gallery with Gutenberg
- How to join Caption AND Description Meta Fields as one combined-caption in Image Block
- Fullscreen Page Background without Plugin [closed]
- Images not showing after wordpres update 5.6
- How to avoid images appear as post in google search?
- Images names not inserting in WordPress Database from Dynamic Add / Remove fields
- How to stop TinyMce from converting image url into ?
- How to automatically load an image inside the post, since it is present in uploads folder
- Generate links on all images in posts – is there a hook?
- Decide how Hero image appears on mobile
- Broken images/videos after migration – DIVI theme- works ok on Mac OS
- Which tools should I use for a gallery that uses an API and url for the path of the images?
- Uploaded images not showing properly using wordpress
- Can’t figure out how to get space around an image? [closed]
- How to best adjust images to a max content width of 490px?
- Set WordPress to Create different images format later, not during upload
- If file exists with page slug name show image else nothing
- How might one programmatically set the link for all images in all posts?
- attachment.php & flexslider—linking thumbnail to specific image
- page displaying media caption shortcodes
- Display different Images depending on the current day
- How to associate an image with a term taxononmy and publish it on frontpage?
- How to add a credit line to a photo caption
- How can i make like this structure?
- Slider do not add alt attribute. Cant get alt attribute from a media library!
- Broken image URL
- Uploading Images for a section
- Some images suddenly not appearing
- Stop Attachment image names from taking top level permalink
- WordPress: Preload next post images
- Image not showing in an archive page
- Set add_image_size() greater than content width in media box
- Featured Image not displaying [closed]
- Remote Image (from URL) as Media Library element
- Theme using masonry layout script rendering overlaped images in Google Chrome [closed]
- Why is inline CSS added to images automatically? [closed]
- Serve images as webp if browser support
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- Attachment tag archive
- Using medium_large image size