WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 1 down vote accepted

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:


share|improve this answer
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! – Jonathan Thornton Jun 29 '13 at 2:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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