You are using get_option()
wrong, first variant, so take another look at the get_option()
documentation. Basically you can’t directly access an array element with the function, it just doesn’t support it.
The second variant should be possible, but you need at least PHP 5.4 – if I’m not totally mistaken; I don’t know anything about dreamweaver.
The reason why you can’t access the variable everywhere you want is the variable scope, read up on it at the PHP Manual: Variable scope.
The easiest thing I imagine is to do it the old fashion way, just make a function you can use. Exemplary like this:
function wpse_179693_echo_my_options_array_value() {
$social_options = get_option( 'sultenhest_theme_social_options' );
if ( isset( $social_options['twitter'] ) ) {
echo $social_options['twitter'];
} else {
return FALSE;
}
}
Related Posts:
- How to store widget fields data as an array?
- How can I make my options in an array and store theme in WP options one DB row?
- How To Add New Option Types To Option Tree?
- Modular theme settings
- How does WordPress decide what template to use as frontpage
- Get category slug and display it on a query_post
- Override Current Theme Setting in wp_config.php
- How to set the default value of a option in a theme?
- Why might $input (Settings API) be coming through empty?
- Multiple Custom_Background, is it possible?
- Static Front Page problem
- two tinyMCE editors in the same page
- How to use bloginfo( ‘template_directory’ ) in array
- Cannot update WordPress General Settings Site Title and Tagline
- How to upload images using Settings API
- Theme settings keep getting reset/erased
- Where should I update_options in a theme?
- How can I display/hide certain content based on a Theme Option field?
- How to Call pages from a Options Panel
- Efficiency of wp_options vs a new table
- Redirect to another page using contact form 7? [closed]
- How to set wp_options in functions.php for removeing the Default Front Page
- Override plugin option by with a custom theme
- not getting API setting saved confirmation message after update on option page
- Update Specific Key Value in Complex `wp_options` object
- How to remove permalinks links presents in each page of my site?
- Tabbed theme options query about add_settings_section callback function
- Array for WordPress Avatar Size and Class
- Unable to delete option
- Theme Option’s Save Button is not working
- Extracting Distance from FacetWP Proximity Function to Display in WordPress Template
- get_template_part vs action hooks in themes
- how can I add an icon/image for a child theme?
- Caching and Versioning for rtl.css
- Getting instance variable in scope of ‘wp_enqueue_scripts’
- How to change admin bar color scheme in MP6 / WP 3.8 front end?
- Google Maps not displaying in wordpress using Google Maps Javascript API
- How to display wp_nav_menu() conditionally only when not on a 404 page?
- Suggestions for creative use of post format feature, or themes that use them well
- Add a #hash to the links in my custom menu
- How can I remove specific custom post meta from the “Custom Fields” fieldset?
- Featured Image Size
- Writing Clean WooCommerce Styles
- Wrong path for theme assets
- one time popup after theme activation
- Passing array in add_option()
- Create a theme by combining a parent and a child theme
- retrofiting old blog
- how do you create an admin interface in plugin for your theme
- WordPress add options to theme not displaying
- What is the right way to set up a one-page portfolio theme? [closed]
- When trying to override plugin’s function by theme, my filter executes two times, I want it to run only a single time
- Highest number of WordPress Custom Page Templates?
- Difficulty loading jQuery with wp_enqueue_script
- Unable to check if image uploaded by wp_image_editor exists using file_exists function
- How do you replace content generated by custom fields with custom blocks in Block Editor?
- How to add styles set by user in the customizer
- Issue with loading mobile specific custom single page layout in mobile
- Add attachment for all images in post
- Is it possible to include an HTML flat-file website inside a WordPress theme?
- Static home page with “Blog” inside?
- How to have content scroll over background
- Need help with adding templates (archives and sitemap) to WordPress child theme
- save_post action doesn’t passing post id to my function as argument
- How can I change the theme of different posts using a plugin?
- Include jQuery (or anything) inside Custom Options Panel’s tag
- Exclude custom post type from search conflict with get_posts
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- How to obfuscate theme directory URLs
- Remove specific published page when theme deactivated
- Is there a WordPress boolean for “theme_customizer_active()”?
- Post and page content not displaying in search results
- Templates dropdown not appearing using _s theme (underscores)
- get_header action not working
- Navbar- disable “onClick” drop-down
- Some doubts about WordPress handle the horizontal main menu visualization
- How To Display Value from Theme Options Field in Front End Template?
- Changing footer depending on URL (poli language site)
- Using Foundation 5 off-canvas-menu with WordPress
- How to set a custom URL for the iframe in the customize page
- Cart displayed above header
- Post Featured Image Custom Sizing?
- Theme: dropdown hover menu not showing up in IE/Edge
- How to Show Next, Previous, and Page Numbers with wp_link_pages
- how to ensure responsiveness in wp themes? [closed]
- PHP Script on a template page & dealing with URI’s
- home is not working in wordpreess
- Responsive Images with art direction
- Correct form of escaping and localization – functions.php breadcrumbs
- Activating theme in local MAMP installation results in HTTP ERROR 500
- Where to find this broken link in order to remove it
- background_image support multiple image size?
- Support Multiple featured images
- Programatically add a page in WordPress
- How to highlight current menu bar base on the URL?
- How to remove proudly created by WordPress in theme?
- How to load custom php file in WordPress themes
- Roll my own theme or customize an existing one [closed]
- Creating image grid on products page in wordpress
- What is the point of using archive.php instead of index.php?