The custom background is a WP feature that gives special support to backgrounds on the body tag. To use this feature it must be activated in the theme.

learn more… | top users | synonyms

7
votes
2answers
1k views

How do I add settings to the Background Options Page?

I am developing a theme and I wanted to add some extra content to the built in background options page. I know how to use the settings API to create new theme options and settings but I can't seem to ...
4
votes
2answers
45 views

Display custom_background outside wp_head()

My theme is a very small one page theme which really doesn't need all the scripts, so I've created a few options to remove wp_head() and wp_footer() so the user can choose if they want to enable or ...
4
votes
1answer
7k views

Change background color with a dominant from picture

Im looking for a smart way to change the background color for a page, but taking the #xxxxxx value from the dominant color of the headline picture. In twenty eleven theme, I can set a random image ...
4
votes
1answer
370 views

How to get attachment id of background image?

I'm looking for a way to get the ID of the background_image when I am using custom headers? I tired using url_to_postid like this: $url = get_header_image() $postid = url_to_postid( $url ); and ...
4
votes
1answer
1k views

How WP_Customize_Background_Image_Control is supposed to work?

I'm trying to add a second background image function to my theme customizer with this code. // HTML Background Image $wp_customize->add_setting( 'html_background_image', array( ...
3
votes
1answer
149 views

Editing the custom background CSS

I have added the add_theme_support( 'custom-background'); function to my functions.php but the CSS which will be added to the wp_head isn't the way I want it to be. <style type="text/css" id="...
3
votes
2answers
894 views

Multiple Custom_Background, is it possible?

Is it possible to create multiple "custom background" administration pages? A site I'm doing now needs 2 different background in 2 different areas, I would really love giving my client the same ...
2
votes
2answers
7k views

How to customize a divs background dynamically using Advanced Custom Fields Plugin?

I've gotten as far as creating custom post types, custom fields and linking those to templates on this first time WordPress project i'm working on, but i seem to have run into a problem i'm not easily ...
1
vote
2answers
1k views

Custom background for the index page only?

I am stuck at add_custom_background. I can change background color/image but I only want to change my index page. Currently, the changes apply on the whole page. I want to make the changes from WP-...
1
vote
1answer
7k views

featured image as background image on pages

I'm adding a featured image on my page through the dashboard and I want to use it as a background image on the container div of the page. I want to apply the background image through css, so I am ...
1
vote
1answer
195 views

Is this possible to attach the background image to a div instead of body?

Currently, adding a custom background image via WordPress will attach it to the <body>. Is there a hook to tell WordPress to attach the background image to another element? Instead of having ...
1
vote
3answers
153 views

How to add background image control to page admin controls?

I understand that each page is assigned its own class such as .page-id-22 & I can use that to assign a background image to it using the stylesheet but I've seen a theme that adds a control to the ...
1
vote
1answer
231 views

Add custom background to div in home page

I want to have featured image on specific div on home page that could be changed in customizer. I saw in documentation custom background for body(https://codex.wordpress.org/Custom_Backgrounds) But I ...
0
votes
2answers
531 views

Custom header tiling?

I've been playing with the wp custom header and background options. I like the way you can tile a small image for the background, and looking for a way to add that option to the custom header image ...
0
votes
1answer
209 views

Different background images on different sites [closed]

I use wordpress 4.0.5 and Minamaze Theme (https://wordpress.org/themes/minamaze) The Minamaze Theme gives me the opportunity to add custom CSS, without having to edit any files, so I added: body, #...
0
votes
3answers
417 views

Change background color of subpages

I have several pages, which are ordered like this: Home Projects - Project 1 -- Project 1 Subpage 1 -- Project 1 Subpage 2 - Project 2 -- ... And I want to change the background color (in this case ...
0
votes
2answers
3k views

I can't change the body background-color through style.css

Using a child of Twenty Twelve, I've been adding color to all the major containers (#main, #content, #secondary, etc.) using #arbitrary-id { background-color: #dedede; } This works for everything ...
0
votes
2answers
412 views

Implementing “Random” to custom-background

I have a client site that requires a random background image. I figured that custom-background would have something similar to custom-header for randomizing which image is selected, but alas it does ...
0
votes
1answer
42 views

How to use WP Theme Option: Custom_Backgrounds on specific element?

I want to use the WP Theme option Custom_Backgrounds on a specific div. By default it adds it to the body and I dont see a way of changing this. Does anyone know how?
0
votes
1answer
544 views

HowTo: develop WP template with dynamic background image

Is there a way to develop a WP template which, amongst others, sets the background image of a certain element dynamically by choice from admin backend? Think of an page editor who simply picks an ...
0
votes
2answers
169 views

Change the background of each post according to the category

I am using the Hueman Theme. What I want to do is that the background of all the posts should change according to the category of the post. Please suggest something
0
votes
1answer
718 views

Custom Background default color not changing

I need to set several default states for a theme's background. The idea is that the background changes upon choosing a color scheme. Everything is working and changing EXCEPT the background color. The ...
0
votes
1answer
97 views

Random sidebar/widget background

Does anyone have a clever idea to get a random/changing background for just the widget sidebar?
0
votes
1answer
91 views

Restrict size of custom background image

Is it possible to restrict the size of the custom background image? I recently released a theme and I notice that people are uploading very large images to use as background image which of course ...
0
votes
1answer
646 views

Random home page background images with caption text

all. I am developing a Wordpress theme and I need to have a random background image display on the home page with specific text for each image. I have installed the Background Manager plugin (http://...
0
votes
1answer
263 views

Get background color for Live Preview with Theme Customization API?

This could very well be a stupid question, but I'm working on a WordPress theme (check the link to see what I'm talking about, then read on)... You'll see the Post Formats icons are surrounded by a ...
0
votes
2answers
1k views

Display background color or image with custom meta box?

With custom meta boxes, how would I go about displaying the background image (or color if no image is linked) within the page. Code for the page where I want data to displayed. I want to apply the ...
0
votes
1answer
312 views

Post to inherit custom category background image from parent

I have a custom field on a category where you can add an image. I have it as a background image to show on the category's archive page, like so: archives.php <body style="background:url('<?php ...
0
votes
1answer
366 views

Rotating background images with admin options

I recently saw an admin panel that had options to set background images for a page. The option was found on from clicking pages and then a "main page". Under the description was a form that allowed ...
0
votes
2answers
23 views

Change Background Color For CPT Template

Please help. Anyone knows of the proper way how to change the background color for a custom post type template only? Using chrome's inspect, I saw that my theme uses the ID of "#main" for all the page'...
0
votes
1answer
17 views

Return value of get_background_color

I want to return the value of get_background_color but that value isn't showing up. <?php echo get_background_color(); ?> I have colors enabled in my customizer, and there is the option '...
0
votes
0answers
17 views

How to Remove background attachments + Background Image must be 1440x900 px

I want to remove the custom_background features; such as the background attachment, position, background repeat, etc etc. Basically every option below the background uploader as you can see below. PS:...
0
votes
1answer
23 views

custom-background callback breaks media uploader

I've added theme support for a custom background/color along with a callback and it seems to be breaking my media uploader, as while the uploader box appears, uploads result in an error and image ...
0
votes
1answer
85 views

Different body image backgrounds on different pages, posts and categories

I am trying to implement the ability to choose a different body background image to different posts, pages and categories. I am using Advanced Custom Fields to add an image field to every post, page ...
0
votes
0answers
59 views

Inline Styling a div from a Custom Metabox

I am building a custom page with repeatable metaboxes that controls content, images and background image. I am having issues when it comes to displaying the background image as an inline style. As of ...
0
votes
0answers
20 views

Change Twenty Twelve background image (multisite)

I'm trying to change the background image of Twenty Twelve theme in a multisite WordPress installation. Is there a way to put the same image for all multisite subdomains? Here's what I'm trying to do ...
0
votes
1answer
119 views

Featured image url

I'm trying to create a bootstrap carousel with the featured image as a background in a div. It works for the first post but the second post isn't loading the right background (it loads the one from ...
0
votes
1answer
71 views

Background image not appearing

I'm trying to add a custom background on a child theme. In the child theme's functions.php, I add add_theme_support( 'custom-background'); and the background option appears under the "Appearance" menu ...
0
votes
1answer
107 views

add class to background image

I'm trying to make a wordpress theme, using as framework the twitter bootstrap. On one page template I need to use the featured image as a background image, so I used this code: <?php global $post;...
0
votes
0answers
17 views

Post's Set Featured Image (Thumbnail) as background of div [duplicate]

How do you set the background of a div to the thumbnail of a post for numerous div's and posts in WordPress? I currently have the following code: <?php if (has_post_thumbnail( $post->ID ) ): ?&...
0
votes
1answer
142 views

Replaceing _custom_background_cb

I'm making a theme where I'm adding support for the custom background feature with this standar function: // fig. 1 <?php function custom_theme_support() { add_theme_support('custom-...
0
votes
1answer
155 views

override a css style

I have the following line in the original theme style.css file: background: none repeat scroll 0px 0px #CCC; In my child-theme.. I want to delete the "background: line.. But how? Update: OK to ...
0
votes
0answers
65 views

Why, when it comes to custom background and image, does 'The first value registered' win?

I'm messing about with overriding parent themes by child themes. The parent theme registers custom backgrounds by hooking add_theme_support('custom-background',$args) to after_setup_theme. Now, if I ...
0
votes
1answer
240 views

Removing backstretch image from pages/posts

Homepage has a backstretch image which is also active throughout the site on posts and pages. How can I keep the backstretch on the homepage but hide it on posts or pages? pulled this from the ...
0
votes
2answers
84 views

background_image support multiple image size?

Does background_image support showing multiple image sizes like feature image? I can see multiple files were created when I uploaded a file. How do I use those images or does background_image not ...
0
votes
0answers
104 views

Programmatically choose a background-color to go with an image?

Is there a function, either in PHP or Wordpress itself, or in a plugin, that will choose a good css background-color to go with a given background-image? For example, if someone chose a very large ...
0
votes
0answers
156 views

background image in post with images on top

I am trying to create a post that consists of a background image with images over the top of it. The idea is that the top images are links overlay on the background. I have used the following css: ...
0
votes
2answers
333 views

Create a body div using CSS [closed]

I am trying to add a white background to just the body and header text on my blog, so that I can add a background image behind the whole site. I know I need to create a div that sits behind the body ...
0
votes
1answer
297 views

How to change the background color of my header dynamically based on a Custom Posts types color value?

I've been able to figure out how to include the custom field i'm referencing within an inline style within a div that wraps my header. The problem is that it's in my header and so when a particular ...
0
votes
1answer
289 views

Problems Replacing Background Color with Static Background Image in Responsive Design

I'm new here. I've tried the WordPress forums and the actual theme forum for my theme with no luck and I heard that this is a good place to come ask questions. I'm hoping someone out there will take ...