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 white circle, which has a border color matching the custom background color. I know that Live Preview includes background color by default, but I'm wondering how to change this border color with the background color, as they need to match.

Really, I just need to know what setting I need to use with postMessage, or if such a mechanism is possible at all.

Thanks for any and all help! I know it's a quite unique situation, since I can't find anything remotely close to the topic here, on Codex, or Google, or anywhere.

1 Answer 1


If you're using the built in custom background stuff, it's already all using postMessage.

So, just bind a function to the background_color message and adjust your border color accordingly.

Something like this, I expect:

wp.customize('background_color',function( value ) {
    value.bind(function(to) {
        jQuery('whatever').css('color', to ? to : '' );

Obviously, change the jQuery call in the middle to adjust whatever you're trying to adjust.

Some of the basics I didn't cover, such as hooking that JS into the previewer and such, are here:


  • It's working...of course it was the one setting I seemed to not try. (I even tried backgroundcolor!) Thanks so much for this and the incredibly helpful tutorial! Jun 29, 2013 at 2:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.