Assuming this array for example usage:
$options = array(
"name" => __('Font','mytheme'),
"desc" => __('Change the font face)','mytheme'),
"id" => "mytheme_font",
"std" => array('size' => '10px', 'face' => 'Arial', 'color' => '#000000'),
"type" => "text",
);
For question 1, to reference nested arrays, just reference them directly.
echo $options['std']['size'];
In the form input, if using the Settings API:
name="mytheme_options[std][size]"
Regarding question 2, it appears to me that you’re probably doing it wrong to being with, as that bit of code you have there makes no real sense. What is get_option($value['id'], $value['std']);
supposed to do anyway?
You’d get your options array from the database like this:
$options = get_option('mytheme_options');
Individual options would then be like $options['name']
or $options['std']['face']
or what have you.
Related Posts:
- Best practices for a Style/CSS based theme options page?
- How do I create my own admin button and theme settings page?
- Moving WordPress.com theme and widget settings to self-hosted site?
- Multisite: setting theme and options when a new blog is created
- Copying theme from Localhost to Live does not copy all theme settings with it?
- Register theme customizer settings when theme activates [duplicate]
- How to mark an option as selected
- Add transparency to wordpress color picker?
- Add a series of checkboxes to theme options
- What’s the order of loading wordpress elements?
- loss of theme options while site deployment in production
- 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
- Full page (no WP admin menus and options) admin theme options
- How to dynamically change theme’s slogan from admin?
- Passing dynamic options from backend to frontend
- Problems to disable the comments for my statics pages
- 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 implement theme option to change bootstrap 4 container from .container to .container-fluid
- Can i add wordpress editor to my custom theme option? [closed]
- Theme Options Menu Item – Permission Issue
- Adding admin-ajax.php to the frontend. Good or bad idea?
- Can wordpress theme folder name be changed freely and nothing technically happens
- How do I add support to my theme for custom menus?
- How do I white label my self-hosted site created by wordpress?
- How To Add New Option Types To Option Tree?
- Free/Open-Source Theme Frameworks as an Alternate to Thesis? [closed]
- can require “themefolder/includes/widgets.php” in “themefolder/functions.php” yet widgets.php doesn’t run
- How do i structure my theme folder to avoid one huge list of files
- Loading template files from a subfolder in my theme?
- How to use scss in wordpress theme?
- How to get Ajax into a theme – without writing a plugin?
- Is it mandatory to have a link to the theme designer?
- How to fetch serialized data from wordpress options
- WordPress as Backend, Laravel Front End: How to connect Routes?
- Updating custom theme that is built from scratch
- single.php change into a modal popup bootstrap wordpress
- get_header(‘header2’) not working properly in child themes
- How do you remove Link backs on Theme settings page?
- Theme broken after upgrading to WordPress 4.5, missing stylesheet?
- Theme Development Admin Area [closed]
- Investigating complex themes still slow even with WP caching
- Is that worth it to find a designer for creating a WordPress theme for selling on ThemeForest? [closed]
- Howto keep header image when changing theme
- setting a different theme for specific category in wordpress
- How do you approach block structured content?
- Child Theme not overriding a template section on live site – but is on local site
- Online theme customizer missing details
- need to aply a different style sheet for a specific page template
- Problem of running development copy of WordPress on WebMatrix?
- Switching content between summer and winter
- How does WordPress load themes? It doesn’t see mine (symlinked)
- translation does not work for ‘Home’
- Buddypress User Settings template location? [closed]
- How to code static pages in WordPress
- Color Options from Theme Customizer API not returning via get_theme_mod()
- Where do I find (free) fully-internationalized themes? [closed]
- How do I manually revert back to my old theme?
- How do I retrieve multiple values from a multidimensional array in wp_options?
- Modifying the markup in the Tag Cloud widget?
- How to trace and resolve a theme problem such as flickering links in WordPress? [closed]
- wp_enqueue_style $dep argument does nothing?
- Is it a good practice to disable wpautop for premium themes?
- Widgets not showing on sidebars
- linking to an svg through comments_popup_link
- How to use custom page templates in a theme that hides page template option?
- Create Custom Attachment Template That is Processed from Plugin Folder?
- After installing a free theme, my wordpress turns into text mode when accessing remotely
- why is this script not working on my site
- Custom theme – pages in menu
- remove preloader in WordPress theme [closed]
- Pharmacare theme login page / login modal redirection to custom URL
- Why my function.php file in theme delete automatically? [closed]
- How to reverse the pagination numbers of an archive?
- Theme translates the_author_posts_link. How can I remove their translation?
- theme installation not working
- Changing a parent theme safely
- How to implement this layout?
- WordPress customizer extremely slow, cant work in it
- Missing privacy policy checkbox on login page (using Enfold theme)
- How exactly does WordPress load themes from api.wordpress.org?
- Themes don’t show up in the dashboard -> Appearance -> Themes
- Let custom text widget use the same font as the theme
- SSL errors when I activate my custom theme
- Theme-based character encoding issue
- Linkedin not returning right info
- How to show taxonomy in WordPress shortcode
- how to load rtl.css file before style.css [duplicate]
- Create a live demo gallery for themes
- Lightword Theme – only one menu item
- How to create an Single-Portfolio page?
- Page structure using The Customizer Api
- What type to upload image within theme options?
- “Parse error: syntax error, unexpected” and the WordPress Theme Editor no longer working!
- Installing themes from an external website [closed]
- get_post_meta() doesn’t allow email