Your code is good except in add_setting. You have assigned option for type parameter. It will save separate option for each field. If you use theme_mod, it will solve your problem.
'type' => 'theme_mod',
Related Posts:
- New WP_Customize API – how does it work under the hood?
- Disable Visible Edit Shortcuts in the Customizer
- How to Add Customizer Setting in Child Theme
- Manipulating post meta in the customizer
- Widgets not working in Customizr but working in Appearance
- In the new Theme Customizer API, how to send a value from the front back to the admin panel?
- get_theme_mod(); returns nothing
- How to get input_attrs in the sanitize function?
- How to change in customizer the “site identity” tab required capabilities
- Customizer image control default value showing in customizer but not on frontend
- Customizer: How do you add HTML to control labels?
- Add new Control to Customizer to modify Headings (h1, h2, h3…) Color
- How to extend nav-menu-item-control data in Appearance > Customize?
- What will happen to the additional CSS when the theme is updated?
- Convert an theme options page to use in customize.php also?
- Add more then one site logo – custom-logo theme support
- Hide devices selection from customizer?
- Fatal error in wp-admin/customize.php after fresh install due to null $wp_customize
- Enabling Additional CSS / custom-css
- Can not sanitize select control in customize api
- Bind JS event to WordPress control customizer
- For a specific theme, how do I build a list of all the possible theme modification names?
- Save & Publish disabled for two dimensional array Customizer
- Allow guests to use WP Customizer but disable save button
- How do I remove a customiser option from a parent theme in a child theme?
- How to add css option to Header Image customizer?
- Trigger Customizer Publish (save) Action
- How to edit alternate inactive themes in “Appearance -> Customise” screen?
- Is it necessary to prefix theme_mod, section id and panel id in the customizer?
- Hide Customizer’s Widget Choices From The List
- theme customizer – can a single option pass multiple values?
- How to remove Customizer’s Section and move Control straight to Panel using Child Theme
- Remove Customizer Control Choices (Type: Radio Array) using Child Themes
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- Dynamic Control in customiser
- Is it possible to rename a customizer control heading?
- Is it possible to add custom badges to product attributes conditionally, based on custom field?
- Will WordPress updates remove Gutenberg Additional Classes?
- Easily add custom HTML outside the main container?
- Customizer options limited to specific user roles?
- Can’t Customize WordPress Page
- WordPress Customizer: Check for value of CSS selector and replace it
- In wordpress customizer api adding div wrap to control
- Apply `the_content’ filter to theme customisation live preview
- retrieve theme custom settings
- Multiple Customizers
- Which IDE best for WordPress Development? [closed]
- Refresh Customize Section (not preview)
- Do i need to use PHP in customizer api?
- Where did I put this one line of css?
- Hover Hide-Visible Additional CSS not working in WordPress website, but shows properly in Customize window
- How do I make my child theme re-apply the settings that were customised when its parent was active?
- How to add a new product type on woocommerce product types? [closed]
- How to add Disqus comment count
- Can WP Customizer work with single pages or posts?
- Enabling Sessions in WordPress 3.0
- How do I add Post Like and Bookmark Functionality to my WordPress Site?
- How to exclude certain widget from showing up on home/front page? [duplicate]
- sanitize attachment filename
- Add filename to attachment page url
- How do I add a new template to my site
- How to add custom page attributes in WordPress?
- How can I use a Tiny MCE editor in my custom Gutenberg block?
- 404 (category, pages, archives) when using custom rewrite rules
- Keep Title and Description always
- Changer numbers of columns in woocommerce shop
- Use custom header as WordPress header
- WordPress : using AJAX to get posts & Sidebar Content to an external application
- How do I modify the size of the text in my page titles?
- WordPress Code Snippet to count total posts by author
- Custom Same Page Search
- Inline-Table under TwentyTwelve not working
- Allow a subscriber to be an author and view only his post
- Transferring theme and imported post attachments
- Personalized Gallery what are my options?
- Trying to use .htaccess to redirect /profile to /login-2?action=profile
- What is my error trying to create a new table in the database?
- retrieve “Link Color” value
- How to add a template – so that i can choose a different menu for some pages
- Allow WP users to sort search result on a videos site
- wp.blocks.registerBlockType not showing what I want on the frontend
- Add a menu item to admin dashboard which isn’t a link? [duplicate]
- How to narrow the area between buttons on Helium theme sidebar? [closed]
- How to add the option to choose between sizes for featured image within post editor?
- Structure of post types for TV Shows and episodes
- Adding images to anchors in the list created and fetched with wp_nav_menu
- Background setting isn’t applied to entire sidebar height
- Function to query by custom field and category
- Secondary loop doesn’t work
- Custom user fields validation on registration
- Pre_Get_Posts order DESC not registering
- Adding pages to the Admin panel
- Share user access between two wordpress sites
- What capability is required to view posts, scheduled in the future, by someone else?
- Adding page Title in a custom coded page
- Reached end of document without finding – using mod_pagespeed
- Background image no more visible in the preview
- I need to make the title of the page dynamic in my custom plugin
- Custom CSS working on home page but not on NEW created PAGE
- Looking for a way to align log in form fields with background image and scale responsively