Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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:

http://ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own-themes/

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
add comment

Your Answer

 
discard

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.