• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How do I enable widget background image customizer for custom page templates?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › How do I enable widget background image customizer for custom page templates?

This topic is: not resolved

Tagged: custom page templates, customizer

  • This topic has 1 reply, 2 voices, and was last updated 6 years, 9 months ago by samw.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • September 21, 2018 at 7:14 am #223340
    jonburr
    Member

    My client loves monochrome pro, but would like front page customizer functionality on landing pages.

    I cloned front.php, renamed it to donations.php, defined it as a template in the header, updated the widget calls, and registered the corresponding new widgets via functions.php. So far, so good - the Customizer sees the widgets.

    I’m getting stuck trying to get widget background image functionality working.
    In /lib/customize.php I see the code below.
    How can I modify this code to add this functionality to “daughter” page templates?
    (Is this the correct approach to solve this problem?)

    function monochrome_customizer_register( $wp_customize ) {
    
    	$images = apply_filters( 'monochrome_images', array( '1', '3' ) );
    
    	$wp_customize->add_section( 'monochrome_theme_options', array(
    		'description' => __( 'Personalize the Monochrome Pro theme with these available options.', 'monochrome-pro' ),
    		'title'       => __( 'Theme Options', 'monochrome-pro' ),
    		'priority'    => 30,
    	) );
    
    	$wp_customize->add_section( 'monochrome-settings', array(
    		'description' => __( 'Use the included default images or personalize your site by uploading your own images.<br /><br />The default images are <strong>1600 pixels wide and 800 pixels tall</strong>.', 'monochrome-pro' ),
    		'title'       => __( 'Front Page Background Images', 'monochrome-pro' ),
    		'priority'    => 35,
    	) );
    
    	foreach( $images as $image ) {
    
    		// Add setting for front page background images.
    		$wp_customize->add_setting( $image .'-monochrome-image', array(
    			'default'           => sprintf( '%s/images/bg-%s.jpg', get_stylesheet_directory_uri(), $image ),
    			'sanitize_callback' => 'esc_url_raw',
    			'type'              => 'option',
    		) );
    
    		// Add control for front page background images.
    		$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, $image .'-monochrome-image', array(
    			'label'    => sprintf( __( 'Featured Section %s Image:', 'monochrome-pro' ), $image ),
    			'section'  => 'monochrome-settings',
    			'settings' => $image .'-monochrome-image',
    			'priority' => $image+1,
    		) ) );
    
    http://(local dev site)
    September 23, 2018 at 2:02 pm #223378
    samw
    Member
    This reply has been marked as private.
  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble