The CSS is generated on the file inc/custom-css.php
, the background color is set on line 76:
$background = sanitize_hex_color_no_hash( get_theme_mod( 'background_color' ) );
So you can take advantage of the theme_mod_{$name}
filter, which changes the value of the get_theme_mod($name)
function, by adding this to your functions.php file:
add_filter(
'theme_mod_background_color',
function( $value ) {
$custom_bg_page_ids = array( 18, 19, 20 );
$custom_bg_color="ca2d2d";
global $post;
if ( in_array( $post->ID, $custom_bg_page_ids ) ) {
return $custom_bg_color;
}
return $value;
}
);
Related Posts:
- is there a simple way to list every templates / php files used to generate a specific page?
- Setting up the child theme so as to enable right-to-left WordPress?
- Understanding child theme functions.php
- Overriding a theme redux file in child theme
- Want to create Child theme, but already edited Parent theme css files and some php files
- Displaying theme options in css
- Parent theme CSS overriding child CSS rules
- How to style options page in dashboard?
- Selectbox in admin panel function linking to CSS
- Can I install/embed WordPress on a ‘single page’?
- Customize position of social icons in upme plugin [closed]
- two columns of posts on homepage, one of them “favorites”
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Clickable image link sends people to wrong URL
- Assign Custom classes to every Excerpt
- How to edit background color of only one sidebar?
- Inline CSS header style priority function.php Child (no enqueing I think)
- Create Columns with Custom Walker and CSS Classes
- Background image no longer fits to screen now that project is in php files
- Why would the child theme load in the Customize preview, but not on the site itself?
- How to locate parent theme functions and add functions to my wordpress child theme?
- How to let mobile navigation menu close when link is clicked?
- how to add functions to my function.php using a child theme?
- custom field – changing an element or background of id div – different versions not working
- Where to find the html for WordPress site? [closed]
- How to remove image on single product and get product to span page?
- Modify arguments for parent theme’s `wp_register_style` via child theme
- Child theme not working properly
- Child-theme suddenly stopped working [closed]
- hello can you advise how to fix the error?
- Get author full name
- Integrating WordPress to my website, while keeping my own authentication system
- Removing jQuery migrate and working with dependencies
- WordPress Customizer: How can you have multiple active callbacks on one control?
- Edit postmeta when user changes user role?
- Need help on WordPress and php
- Multiple pages on one with different HTML
- How to add default images into theme customizer image control?
- wp_enqueue_style with style.php and WordPress functions
- WordPress Ajax Data problem
- Remove all nav menu classes ( but keep useful ones… )
- Minify HTML, CSS, JS with PHPWee?
- Add attribute / custom attribute to product in woocommerce
- WordPress override bloginfo variable
- Shortcode content output but not in correct place
- Add a custom stylesheet for BlackBerry
- Hide wordpress field if data is empty in post!
- Changing layout with wp_customise
- Is there CSS to expand the gallery limit on Index Pages?
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- filter default query to show just selected level of child pages in wordpress
- Menu jumping when calling it via PHP
- Different post styles depending on category
- Modify custom field input data before creating a new post
- Change CSS based on is_user_logged_in
- Underscore – Self hosted fonts
- Change “No Comments” link to “My String” on Blog Post (Find Snippet in Code or use CSS, PHP Solution) [closed]
- Use custom template on custom post type
- Menu Custom Data Attributes
- Highlight the links without using dropdown
- How to modify mobile nav menu text in theme
- Dividing the loop to style post differently
- Where should I copy a PHP file from wp-includes to, in order to override it in my child theme?
- Set cookie for visitor
- wp nav menu: show submenu below li item
- Display movies that apear this day next
- Styling an “active” link outside of WordPress default menu
- I get “Cannot modify header information – headers already sent” when I change my theme
- How to sort posts by active category in WordPress?
- Array data not saving to specified sections. How to make seting independantly?
- Add css class to string
- Integrate otp in my custom singup form
- Removing links from Grouped products
- How do I know if the user is a customer?
- WordPress custom php script to match standard page layout
- How to block specific user id in custom login form?
- admin panel – How to remove “delete” button from category editing page
- I want to fusion the product columns in email table order
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- Google CSE Malfunctions via Chrome/Safari on Mobile When Clicking on Either Search Icon/Menu Icon. How to Make Google CSE Default Theme Search
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Hide author from search results meta, still display date and categories
- Modifying child theme’s header
- WordPress files break if I edit them, but adding a closing PHP tag fixes it
- Add the shortcodes from the enfold theme to the other theme
- Add custom attribute to product’s HTML to woocommerce cart page
- Widget edit and add in any page
- Styling admin page rows in order of importance (checkboxes)
- How can I show only if custom field has content [closed]
- media-uploader insert into post is not inserting
- featured post as div background
- Combining fancybox with multiple thumbnail plugin
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- Show Nav Link To Users Signed In
- PHP Puzzle: Unique Styles with PHP loop
- How to use plugins_url() inside PHP stylesheet file [duplicate]
- WP_Query not returning results
- How do I link the side images?
- How to create a container in php then customise it in CSS
- ‘This Field is Required.’ is Not Displaying on CF7 [closed]