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?
- Multiple Inputs in a Customizer Control
- Embedding a SOAP Client into a WordPress Plugin?
- Remove WordPress theme from a specific page
- How to keep a WordPress site synchronized between two servers?
- difference between esc_attr(), strip_slashes(), strip_tags()?
- Converting primary keys from autoincrement integers to UUIDs
- Adding Custom Link anchors in the top menu that points to specific sections of the site home page
- TinyMCE default link target to “_blank”
- setting a specific home page for logged in users
- Page with several user editable text content
- Fast way to add countries as a custom taxonomy term?
- Programmatically add a custom page/path/url/route to WordPress
- Passing page url into a custom field via the Press-This bookmarklet
- Using transients to store captchas
- Is it possible to have one page with multiple items, or 2 blogs on a site?
- Function to allow “Anyone can register”?
- wp_query get post custom taxonomy in search.php
- Q: How to pull data from custom table to populate zustomizer setting/control select options
- Users can only view their content from the front end
- Localization: I want the backend: english and frontend in defined language
- Theme compression/ minifying or W3 Total Cache – which should I use? [closed]
- How to remove all the items under “Personal Options” on user profile page?
- Can I integrate wordpress with my current website so I can utilize the wordpress plugins?
- Sticky menu for WP custom menubars
- More tag – how do I remove preceding ?
- Salesforce lead tracking with contact forms plugins [closed]
- How can style text like this in wordpress
- Setup database structure with books, authors, languages etc. for publishing house [closed]
- How to remove admin menu pages inserted by plugins and themes in the top admin bar?
- WordPress custom dropdown listings
- Help customising admin bar, removing buddypress links from dropdown
- WordPress in a Subdirectory
- javascript file not working in a plugin template file
- If Term Name Exists, Append a Unique ID to Slug
- How can I display both LTR and RTL language texts on the same page?
- Add button to My Sites dashboard page (multisite)?
- Cannot go to next page on phone but can on computer
- A specific menu inside a page, load different contents without reloading it, under the same link
- How to hide or remove a custom widget area when empty
- Dockerized WordPress is having Nginx Proxy Issues
- Highlight specific user with custom field value
- How to define a static Home page
- let users add multiple divs in static page
- Default Customizer Code
- Multiple Taxonomies Using Custom SQL Query
- Logged in only custom page
- Make Terms Under Custom Taxonomy Use Specific Single.php Template
- Problem Locating and Changing Alt Attribute Of Link
- Adding css and js to a blank page created with custom template
- Applying my own css classes in wp_menus 3?