Luckily, I was facing the same issue an hour ago so I brainstormed for a long time to find a find a solution. I posted it here before seeing this: http://www.hardeepasrani.com/2015/12/using-postmessage-transport-method-for-header-image/
So instead of just using:
$wp_customize->get_setting( 'header_image' )->transport="postMessage";
I used:
$wp_customize->get_setting( 'header_image' )->transport="postMessage";
$wp_customize->get_setting( 'header_image_data' )->transport="postMessage";
After that, in JS, we got the value using header_image.
Hope it helps you. 🙂
Related Posts:
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Function to return true if current page has child pages
- List of all theme customizer control types?
- How to get the registered sidebar’s name by its id?
- One button to change all settings in theme customizer?
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Design view breaking on Pages
- Widgets not showing in my custom theme
- Can’t load WP function into external function
- Set WordPress Default Template
- Customizer: Output default value in Customizer CSS
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Converting HTML Template to WordPress Theme
- Customizer: active_callback and sanitize_callback incompatibility?
- How do I link a button I created in theme customizer to a function?
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- get_template_directory adding FTP root folders in urls
- Is there a hack for using is_page() within the function.php file?
- How can I assign separate stylesheets to different pages?
- How to make sure relative URL works when site is not on root domain?
- Dynamically switch file in get_template_directory_uri() | Function [closed]
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- Menu to the right of screen on desktop using Bootstrap 4
- Where can I find the declaration of `$_wp_theme_features`?
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- How to add button to top of theme customizer?
- Why have on every line
- Using classes instead of global functions in functions.php
- Display random categories on the front page (Finding and Editing Theme Functions)
- Cleaning up WordPress to improve performance?
- Proper use of Output Buffer
- Include a external PHP file into a WordPress Custom Template
- Need help setting default setting value for radio button in theme customizer
- Get author full name
- Is having multiple theme customizers for different pages possible?
- How to export/import theme customizer settings?
- How to remove hardcoded characters from playlists?
- function_exists call in function.php
- How to preserve PHP modifications while upgrading WordPress?
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- Debugging an error: wp_enqueue_style was called incorrectly
- reason of splitting theme files to multiple files
- is there a simple way to list every templates / php files used to generate a specific page?
- Dynamically change feature image in customiser
- Change comments form title on a page by page basis
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- Setting up the child theme so as to enable right-to-left WordPress?
- delete an array element when its date expires
- Understanding WordPress child theme custom JS loading
- How can I loop into two different DIVS without repeating the DIVs
- What does this mean in wordpress? Easy question
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- Underscore – Self hosted fonts
- Separation of presentation and code – WordPress
- WordPress Customizer Default Image
- How to call multiple functions from multiple files into a WordPress page template [closed]
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Why in my theme I can’t see all the statics content under the posts?
- Theme not calling Jquery properly
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- What is the best way to define constant options for a theme?
- How to add the sidebar to all the pages except the home page? [closed]
- Header not properly displaying on archive.php
- Save Custom CSS file in the upload folder dynamically?
- Create page template via functions.php?
- How to create a field in customize and show that in header.php?
- Warning: printf(): Too few arguments in helpers.php file
- How to make function appear in sentence?
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- List post by title length
- home.php show blog posts as grid view
- blank white page when post/update/change option etc
- How to Update an old theme for the latest wordpress version
- get_comments_number() returns 0
- Removing “Powered by” footer using child theme PHP [closed]
- How do i wrap woocomerce attribute in list?
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- How to add aria role and schema markup to custom walker container
- get_page_templates only return templates with “home” in the filename
- Randomize Color Scheme Selection in Theme
- Extract and display user infromation on an automatically created page
- Show different website layout if no sidebar added
- How to correctly load a different version of main menu based on the user language in WordPress? Is it a good solution?
- Why in this WordPress theme I can’t see the Main Menu?
- Displaying Slider in Front Page (home) using Customizr Theme
- Need advice on theme customizer and child themes
- pass html code to worpdress
- Can’t change theme name
- call a string/function from database
- Some problems calling a function into sprintf() inside functions.php template file [closed]
- Customize field names in backend profile edit page through function.php [duplicate]
- Commas in Tag Cloud
- WP insert post Redirect after function has executed
- WordPress redirects page query parameter in URL
- Getting text from custom field from customizer