Preset Creation Issue

So minutes after I posted a tutorial on how to export presets I noticed this problem.

So after I create the preset code and put it in the functions.php file, they show up in the Preset drop down in the customizer. And they work well too. I can even click “Save” and my theme skin changes to the chosen preset.

However, on the drop-down preset list it goes back to “default”.

I click on my “Parallax Pro” preset, the changes appear on the customizer, but the dropdown item goes back to the “defult” preset instead of changing to “Parallax Pro”.

I’ve done this before on other BB theme versions and never had this problem.

Just in case this is my code.

Please advise.

BB Theme 1.3.1.2
BB Plugin 1.6.2
Only other plugin activated is WordFence.

<?php

// Defines
define( 'FL_CHILD_THEME_DIR', get_stylesheet_directory() );
define( 'FL_CHILD_THEME_URL', get_stylesheet_directory_uri() );

// Classes
require_once 'classes/class-fl-child-theme.php';

// Actions
add_action( 'fl_head', 'FLChildTheme::stylesheet' );

function my_custom_presets()
{
    FLCustomizer::add_preset( 'parallax-pro', array(
        'name'      => 'Parallax Pro',
        'skin'      => 'PATH_TO_CHILD_THEME/my-preset.css',
        'settings'  => array(
            'fl-header-nav-search'                                => 'hidden',
'fl-fixed-header'                                     => 'visible',
'fl-header-bg-color'                                  => '#000000',
'fl-header-text-color'                                => '#ffffff',
'fl-header-link-color'                                => '#ffffff',
'fl-header-hover-color'                               => '#428bca',
'fl-nav-font-family'                                  => 'Montserrat',
'fl-nav-font-weight'                                  => '400',
'fl-content-bg-color'                                 => '#ffffff',
'fl-heading-text-color'                               => '#000000',
'fl-heading-font-family'                              => 'Montserrat',
'fl-heading-font-weight'                              => '400',
'fl-body-text-color'                                  => '#000000',
'fl-body-font-family'                                 => 'Sorts Mill Goudy',
'fl-body-font-size'                                   => '18',
'fl-logo-font-family'                                 => 'Montserrat',
'fl-logo-font-weight'                                 => '400',
'fl-footer-bg-color'                                  => '#000000',
'fl-footer-text-color'                                => '#808080',
'fl-footer-link-color'                                => '#ffffff',
'fl-footer-hover-color'                               => '#428bca',
'fl-footer-layout'                                    => '1-col',
'fl-accent'                                           => '#428bca',
'fl-accent-hover'                                     => '#000000',
'fl-topbar-layout'                                    => 'none',
'fl-topbar-bg-color'                                  => '#ffffff',
'fl-topbar-text-color'                                => '#808080',
'fl-layout-width'                                     => 'full-width',
'fl-preset'                                           => 'default',
'fl-body-bg-color'                                    => '#f2f2f2',
'fl-heading-font-format'                              => 'none',
'fl-header-layout'                                    => 'right',
'fl-logo-font-size'                                   => '30',
'fl-nav-item-spacing'                                 => '15',
'fl-nav-link-color'                                   => '#808080',
'fl-nav-hover-color'                                  => '#428bca',
'fl-nav-font-format'                                  => 'uppercase',
'fl-nav-font-size'                                    => '16',
'fl-layout-shadow-color'                              => '#d9d9d9',
'fl-nav-bg-color'                                     => '#ffffff',
'fl-footer-widgets-bg-color'                          => '#ffffff',
'fl-topbar-link-color'                                => '#428bca',
'fl-topbar-hover-color'                               => '#428bca',
'fl-nav-text-color'                                   => '#000000',
'fl-footer-widgets-text-color'                        => '#808080',
'fl-footer-widgets-link-color'                        => '#428bca',
'fl-footer-widgets-hover-color'                       => '#428bca',
'fl-layout-spacing'                                   => '0',
'fl-layout-shadow-size'                               => '0',
'fl-h1-font-size'                                     => '36',
'fl-h2-font-size'                                     => '30',
'fl-h3-font-size'                                     => '24',
'fl-h4-font-size'                                     => '18',
'fl-h5-font-size'                                     => '14',
'fl-h6-font-size'                                     => '12',
'fl-header-bg-gradient'                               => '0',
'fl-header-bg-repeat'                                 => 'no-repeat',
'fl-header-bg-size'                                   => 'auto',
'fl-footer-bg-repeat'                                 => 'no-repeat',
'fl-header-padding'                                   => '15',
'fl-logo-text'                                        => 'Demo 1',
'fl-nav-bg-position'                                  => 'center top',
'fl-body-bg-repeat'                                   => 'no-repeat',
'fl-body-bg-position'                                 => 'center top',
'fl-body-bg-attachment'                               => 'scroll',
'fl-body-bg-size'                                     => 'auto',
'fl-mobile-nav-toggle'                                => 'icon',
'fl-header-content-layout'                            => 'none',
'fl-header-bg-attachment'                             => 'scroll',
'fl-footer-widgets-display'                           => 'disabled',
'fl-footer-col1-layout'                               => 'text'
        )
    ));
	
	FLCustomizer::add_preset( 'agency-pro', array(
        'name'      => 'Agency Pro',
        'skin'      => 'PATH_TO_CHILD_THEME/my-preset.css',
        'settings'  => array(
'fl-header-nav-search'                                => 'hidden',
'fl-fixed-header'                                     => 'visible',
'fl-header-bg-color'                                  => '#333333',
'fl-header-text-color'                                => '#ffffff',
'fl-header-link-color'                                => '#ffffff',
'fl-header-hover-color'                               => '#d7c603',
'fl-nav-font-family'                                  => 'Spinnaker',
'fl-nav-font-weight'                                  => '400',
'fl-content-bg-color'                                 => '#ffffff',
'fl-heading-text-color'                               => '#333333',
'fl-heading-font-family'                              => 'Spinnaker',
'fl-heading-font-weight'                              => '400',
'fl-body-text-color'                                  => '#333333',
'fl-body-font-family'                                 => 'EB Garamond',
'fl-body-font-size'                                   => '16',
'fl-logo-font-family'                                 => 'Spinnaker',
'fl-logo-font-weight'                                 => '400',
'fl-footer-bg-color'                                  => '#f5f5f5',
'fl-footer-text-color'                                => '#000000',
'fl-footer-link-color'                                => '#d7c603',
'fl-footer-hover-color'                               => '#000000',
'fl-footer-layout'                                    => '1-col',
'fl-accent'                                           => '#d7c603',
'fl-accent-hover'                                     => '#000000',
'fl-topbar-layout'                                    => 'none',
'fl-topbar-bg-color'                                  => '#ffffff',
'fl-topbar-text-color'                                => '#808080',
'fl-layout-width'                                     => 'full-width',
'fl-preset'                                           => 'default',
'fl-body-bg-color'                                    => '#f2f2f2',
'fl-heading-font-format'                              => 'none',
'fl-header-layout'                                    => 'right',
'fl-logo-font-size'                                   => '28',
'fl-nav-item-spacing'                                 => '15',
'fl-nav-link-color'                                   => '#808080',
'fl-nav-hover-color'                                  => '#428bca',
'fl-nav-font-format'                                  => 'none',
'fl-nav-font-size'                                    => '14',
'fl-layout-shadow-color'                              => '#d9d9d9',
'fl-nav-bg-color'                                     => '#ffffff',
'fl-footer-widgets-bg-color'                          => '#ffffff',
'fl-topbar-link-color'                                => '#428bca',
'fl-topbar-hover-color'                               => '#428bca',
'fl-nav-text-color'                                   => '#000000',
'fl-footer-widgets-text-color'                        => '#808080',
'fl-footer-widgets-link-color'                        => '#428bca',
'fl-footer-widgets-hover-color'                       => '#428bca',
'fl-layout-spacing'                                   => '0',
'fl-layout-shadow-size'                               => '0',
'fl-header-bg-repeat'                                 => 'no-repeat',
'fl-header-bg-size'                                   => 'auto',
'fl-footer-bg-repeat'                                 => 'no-repeat',
'fl-header-padding'                                   => '7',
'fl-nav-bg-position'                                  => 'center top',
'fl-body-bg-repeat'                                   => 'no-repeat',
'fl-body-bg-position'                                 => 'center top',
'fl-body-bg-attachment'                               => 'scroll',
'fl-body-bg-size'                                     => 'auto',
'fl-footer-col1-layout'                               => 'text',
'fl-mobile-nav-toggle'                                => 'icon'
           )
    ));
}

add_action( 'after_setup_theme', 'my_custom_presets', 11 );

I just saw my mistake.

I forgot to delete this array!

'fl-preset' => 'default',

Hey Luis,

Glad you figured it out and thanks for sharing what was causing it! :slight_smile:

Ben

Is it possible to remove all the other presets from the dropdown list?

Hey Matthew,

That certainly is possible! Check out the KB article below for more info! :slight_smile:
http://forum.wpbeaverbuilder.com/knowledge-base/adding-and-removing-presets/

Ben