You need only use the default value on the wp_customize and that is all
$wp_customize->add_setting('mytextoption', array(
'default' => 'defaultvalue',
'capability' => 'edit_theme_options',
'type' => 'option',
replace defaultvalue for the value you want, and when the user activate the theme this line will register the default value on the DB only when not exist on the DB
Related Posts:
- Multisite: setting theme and options when a new blog is created
- Link to specific Customizer section
- When cropping a header image, retain meta data (i.e. name, description, etc.) from original image?
- Best practices for a Style/CSS based theme options page?
- How to refresh WordPress Customizer panel upon entering a value
- How do I create my own admin button and theme settings page?
- Looking for a way to load a function after customizer preview refresh complete
- Moving WordPress.com theme and widget settings to self-hosted site?
- Is it possible to stop a theme activation when a certain plugin is not activated
- Display custom_background outside wp_head()
- How do I change Twenty Nineteen’s primary color without using the color slider in the theme customizer?
- Copying theme from Localhost to Live does not copy all theme settings with it?
- Passing array in add_option()
- How to mark an option as selected
- Add transparency to wordpress color picker?
- How to change the themes “Live Preview” url within the Appearance->Themes page?
- Theme Customizer – How to create a sub panel
- Working with an Array inside Your Theme Options Array – Multiple Values
- Add a series of checkboxes to theme options
- What’s the order of loading wordpress elements?
- Create register form without a plugin
- How to conditionally display widgetized areas in theme customizer?
- loss of theme options while site deployment in production
- Create more than one section in Theme Customizer
- Theme settings default, strange behavior before first save
- How to find out if page_for_posts is showing (in order to style menu item)
- New custom theme option (text input) giving index error
- How do you approach block structured content?
- Own Theme Customizer displays error message when saving, saving still works
- Child Theme not overriding a template section on live site – but is on local site
- Full page (no WP admin menus and options) admin theme options
- Need help with making a website where user can add products
- How to dynamically change theme’s slogan from admin?
- How do I remove ‘Active Theme’ section from Customizer?
- Passing dynamic options from backend to frontend
- Problems to disable the comments for my statics pages
- Color Options from Theme Customizer API not returning via get_theme_mod()
- Interpretation and explanation of register sidebar
- WordPress setup one database with two different website?
- How to include stylesheet in custom admin using parent_slug
- Get data from Theme Options and use them into meta options field in custom post type
- What’s the easiest way of adding more options in the Theme Options of the twenty eleven theme?
- How to validate new added field (Phone number) which is added to registration form?
- wordpress-theme 2017: featured image behaviour: where to set the height of the featured image?
- WordPress customizer extremely slow, cant work in it
- Dynamic image for Jumbotron on WordPress Custom Theme
- How to implement theme option to change bootstrap 4 container from .container to .container-fluid
- Issues with dynamic widget in theme customizer
- Theme customizer hiding sections
- WP Customize API Checkbox change value
- WordPress Customazation API section in section
- Can i add wordpress editor to my custom theme option? [closed]
- Register a widget area when a theme option has been saved?
- Theme Options Menu Item – Permission Issue
- Page structure using The Customizer Api
- WordPress Theme redirects to the Index page – Theme customizer problem
- What’s the best way to go from a design to a customized WordPress site?
- How to Link External jQuery/Javascript files with WordPress
- How to set two different themes on one WordPress? (Desktop vs. Mobile)
- How can I add a set featured image function to a theme that doesn’t already have it built in?
- Jquery in Child Theme
- Retaining old HTML archives and displaying themes conditionally
- possible to make sections in theme customizer sortable and saveable at publish button clicked?
- Question about the way that wp_register_script works
- Specific theme for non logged in users
- How to change the contact info at the bottom of my theme [closed]
- Customize “Continue Reading” text [closed]
- WordPress not displaying themes in the wp-content/themes folder
- How to create child theme of already active and customized theme
- How To Remove The “Delete” Theme Option In Dashboard
- How Do I Use A Custom Mobile Theme?
- How can I make a different theme be viewed for logged in users vs guests?
- What is calling this parallax-slider.less file that is missing? [closed]
- Random 404 error on WP
- Theme option not saved if in wp_editor() and html decoded
- Customizer – loading settings/controls/sections/panels based on a id/page id
- I have no images in an activated wp theme
- My new WordPress theme based on the TwentyEleven theme doesn’t display the front page OR the blog page
- WordPress Customizer Default Image
- Translate a site based on different themes
- Template messed up on viewing posts
- Show hyperlinks only when user is loggedin
- I don’t know how to put a placeholder [closed]
- How can i set default pages to a word press theme? it shouldn’t be changed even if i install the theme in different host
- WordPress 2022 template, how to see the blocks added in post template on post edit?
- Two themes using a Multiple Themes plugin
- Broken theme, stylesheet is missing after uploading the right theme via FTP
- I cannot get an Advanced Custom Field code snippet to work – and ACF support say it should work
- WordPress thinks my custom theme is a theme in the public theme repository
- Phone numbers showing same color as header [closed]
- Baskerville Theme – How to use the masonry grid layout on other pages
- Will this js code work in a page template?
- Create /archive page in WordPress Theme
- How can I allow a client to edit certain parts of a static site?
- To create a theme or use an existing one? [closed]
- Overwrite functions.php of a theme – What if the theme is updated?
- How to add/edit content Custom Content item in theme
- Is there a WordPress theme for twittstrap? [closed]
- How to make a multilingual wordpress site to be translated one-to-one without much effort and without using translate?
- Table of Contents in Left Navbar [closed]