Neither.
Theme options should be stored as theme mods, using get_theme_mod
and set_theme_mod
.
Internally these map on to options, but it is the official way to store theme specific options, that way when you change themes you don’t get clashes, and your settings are preserved for if you ever change back. It’s the classic adage of “someone else solved that problem for me, it’s their problem now”
But should you persist in using options, I would advise you prefix all your options with your theme name, and not to share options between child and parent. Setting a child themes options should not affect a site when moving back to a parent theme.
There may be cases when it is advantageous though, so exercise good judgement ( aka use set/get_theme_mod
)
You can find more about this API here
Related Posts:
- Switching among theme customizations
- Color Options from Theme Customizer API not returning via get_theme_mod()
- WordPress activate theme error $pagenow
- Opinions and recommendations on the best barebones base theme [closed]
- How to move the sidebar in TwentyFifteen to the right?
- Override parent theme translation on child theme
- Starter Theme vs Parent Theme? Pros and cons
- How to set thumbnail image for a (child) theme
- Do Child-Themes automatically load the Translation from the Parent-Theme?
- Best practices for a Style/CSS based theme options page?
- How to use media upload on theme option page?
- Difference between stylesheet_directory and template_directory
- How to override the “inc” folder (or any folder) in a theme using child theme?
- How to export/import theme customizer settings?
- Add a page outside of the current theme?
- Jquery in Child Theme
- Removing Shortcodes from Child Theme
- Edit theme wp_head
- Which settings/options are saved on a theme-basis and how does this affect theme-switching?
- Are custom inner theme folders in any way overridable by child themes?
- How to avoid loading style.css twice in child-theme?
- Remove action within a class in a parent theme from the child theme
- Getting rid of unused css directives [closed]
- Switch Theme Through Options Panel
- Override parent theme translation on child theme
- Theme Activation, Create Database Tables
- WordPress Backup
- How to make alert for new version on theme options?
- I want to run different WordPress websites under the same database
- Child-theme breaks site
- How to mark an option as selected
- get_header(‘header2’) not working properly in child themes
- Is it possible to use child theme of child them?
- Change logo on each page of University Hub theme [closed]
- Delete database tables on theme uninstall?
- How do I copy my Parent Templates to my Child Templates?
- How can I show more than 15 themes at a time in the admin menu?
- How to go about pre generating css file with variables from theme options
- Can I create multiple instances of the BuddyPress Activity Stream with separate themes? [closed]
- Can’t Install Child Theme “The parent theme is missing. Please install the “Default” parent theme.”
- Does uninstalling a WordPress theme delete its database values?
- Cannot find the code for “Edit This” link in posts in a specific theme
- Can I rename a theme’s folder and still receive updates?
- Child theme not visible
- Overwriting templates in child theme and performance
- Defining different theme for Blog posts page
- Themes—Child Themes
- How to set different settings for a mobile theme?
- How to load parent theme style.css?
- Child theme not using parent theme css/styles/formatting?
- Child Style.css not overriding parent theme style located in assets/css/main.css
- Disable Theme API / Front end (for API only environment)
- Does theme update also update a child theme zip
- What’s the proper way to include inlined javascript-source?
- What is the major difference between child theme and normal theme
- How to understand a specific bit of WordPress syntax
- How does a Child Theme works?
- Creating new templates in child themes breaks layout
- Creating a theme options page
- How to create child theme of already active and customized theme
- Are theme .php files stored in the database?
- Inject widgets from one sidebar into another with PHP
- Where all are child themes recorded when they are created in WordPress
- I have some doubts regarding how to implement child theme
- Posts and Pages not showing on admin, but showing in theme
- How do I get rid of or change the footer in my child theme?
- How Do I Use A Custom Mobile Theme?
- How can I make some themes usable only by admins?
- Custom options below pages/posts editor?
- How to change only one javascript function in wordpress child theme?
- Mobile issue – website isn’t properly detecting screen size [closed]
- Edited Child Theme’s “header.php” but it doesn’t appear to change the file
- Updating my free theme delete all my changes [closed]
- Switching to a child theme
- 1 Database for multiple WordPress themes
- Getting 503 on various files
- Redux callback action
- Port existing Bootstrap site to WordPress?
- Do not show one specific widget on one specific page
- How can we hide the parent’s theme url at the child themes details on a multisite?
- Is it possible to create child themes using the WordPress Dashboard?
- Preserve theme settings when migrating from local to live
- how do i in ignore/disable/delete a javascript call from parent in child theme?
- Functions containing parameter ‘yourtheme’
- How to transform a custom made static HTML website to a WordPress website [closed]
- What is the “pub” theme? [closed]
- Can I create a child theme from a premium theme without losing my posts and page etc that I already have?
- Enqueue custom css file on specific page
- Child theme’s stylesheet cannot load [closed]
- Passing dynamic options from backend to frontend
- Creating a child-theme: CSS not loading
- simplified explanation on child themes?
- Using the same database on another Subdomain
- How to override theme class function to child theme? [closed]
- What’s the default order used by WordPress to load CSS files?
- The requested theme does not exist. Stylesheet is missing – error after changing style.css name to my-styles.css in wp child theme?
- Issue with theme mod options during domain migration
- Why submenu item’s background color is not changing by css?
- How to add custom JS file in WordPress Child theme with get_theme_file_uri
- .PO file is found but I don’t see translations: how to debug the problem?