Follow us on

Codestar Support Forum » WordPress Plugins » Codestar Framework

Customizer Preview not Working

  1. Hi,
    I've been struggling Customizer output from yesterday. I can't find any value updating on output. Here's my code

    Prefix: customizer_prefix

    array(
            'id'      => 'test_bg_color',
            'type'    => 'background',
            'title'   => 'Background',
            'default' => array(
                'background-color'      => '',
                'background-position'   => 'center center',
                'background-repeat'     => 'repeat-x',
                'background-attachment' => 'fixed',
                'background-size'       => 'cover',
            )
        ),CopyCopied!
    wp.customize('customizer_prefix[test_bg_color]', function (setting) {
    
            setting.bind( function (val) {
    
                console.log('BG Change', val);
    
            });
        });CopyCopied!

    The problem is Console isn't triggering. If I try to Console settings before bind. It's showing "undefined".
    Seems like my Customizer Settings isn't working. I need the solution badly.

    Posted 2 years ago #
  2. Live Changing data isn't working. Please help me, I'm stuck on this critical issue.

    Posted 2 years ago #
  3. What's the point of not getting response !!!

    Posted 2 years ago #

  4. Codestar
    Admin

    Hi,

    Sorry buddy. I was busy a little. why you are shouting

    In the customizer there is a parameter called by "transport" this parameter is "refresh" by default. You should to change it as "postMessage". I mean:

    array(
      'id'        => 'test_bg_color',
      'type'      => 'background',
      'title'     => 'Background',
      'transport' => 'postMessage', // this parameter
      'default'   => array(
          'background-color'      => '',
          'background-position'   => 'center center',
          'background-repeat'     => 'repeat-x',
          'background-attachment' => 'fixed',
          'background-size'       => 'cover',
      )
    ),CopyCopied!

    then you can try again.

    Btw, don't miss see: http://codestarframework.com/documentation/#/faq?id=how-to-use-customizer-js

    Regards, Codestar

    Posted 2 years ago #
  5. I've checked the link hundred times and tried to understand. But it doesn't help me.
    I've figured out after 3 days of hard work. I've tabbed settings. It's very hard to understand from your Documentation and Controls settings.

    Posted 2 years ago #

  6. Codestar
    Admin

    Hi,

    Yes, Customizer is needed a little up level knowledge, but you can understand easy.

    "tabbed field" inside "background field" control will difficult.

    Regards, Codestar

    Posted 2 years ago #