You can either use the Wordrpess Settings API or you can use an options framework. My team built a pretty awesome options framework that’s easy to drop into your theme. It’s called the UpThemes Framework. You can grab a copy of it at github. https://github.com/chriswallace/UpThemes-Framework
To install simply drop the admin and theme-options folder into your theme directory. Edit the theme-options files to add more options as you were attempting in your code. Lastly add this to your functions.php file.
require_once('admin/admin.php');
You will then have all the option values at your finger tips by using the following in your templates.
global $up_options;
echo $up_options->option_id;
We are still in the process of documenting out all of the option types (typography management, color picket, etc). You can see some of the features here.
Related Posts:
- Upload Multiple Files With media_handle_upload
- How to get the image EXIF date/time and use it for the WP post date/time
- AJAX handler throws 400 (Bad request) – why?
- ajax live search for post title
- delete uploaded file
- Apply jquery script to only woocommerce product pages and categories
- Replacing select2 in admin backend for all selects
- How to add an export function to a custom Option Theme Page
- Max file size not updating
- jQuery plugin function is not a function
- Theme options WP Editor
- Display a function using AJAX
- Enqueuing Script in functions.php vs on the page
- Allowing SVG uploads in media uploader without plug-in
- Custom image size in Media Dropdown
- Unable to get_the_content(); of a post in WordPress via AJAX
- Add external js file to footer with id
- Ajaxing function in widget class
- How to load some jquery code to make validation in the theme customizer?
- woocommerce target button with class after ajax update
- Move jQuery and Migrate to footer?
- Images uploaded using media uploader are appearing upside down
- jquery won’t load in footer
- How can I enable uploading excel files?
- WordPress doesn’t Load JQuery Now? Do I need to enqueue JQuery also?
- Woocommerce checkout field maxlength, make input number field only (postcode)
- Simple custom theme option not being saved
- Replace menu links with # and add name to its li
- Can I hide certain upload folders in media library [duplicate]
- WordPress upload_mimes not working for front-end uploads of 3D files
- Loading CDN that requires jQuery in WordPress
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Right way to update widget on dynamic new input field
- How to load jQuery in the footer – nothing works for me
- Not sure if enqueuing js scripts properly
- Image rotation fails to regenerate custom sized thumbnail
- Wp_query function to search from product_title ‘OR’ product tags name
- Disable auto-resizing of uploaded images, but only for certain filename
- Allow Post Author to be 0 on Update
- Trouble with adding a wp_enqueue_script on wordpress
- WP Ajax Function Always Returning undefined
- Scripts not appending to element in AJAX call – why?
- When sale price is 0.00 show only regular price
- How to change the order of Jquery in the footer of my theme?
- How to search using ajax for exact phrase or words in an input field?
- how to en-queue jQuery to load before the tag
- Jquery implementation not working on page reload
- I can’t enqueue my scripts – They literally aren’t being added to my site
- Attempt to change jQuery version caused White Screen of Death
- Generating dynamic css into custom file [closed]
- Can’t generate thumbnail images
- PHP mixed with some JS code to update WordPress theme settings
- Load jquery only for certain pages in the backend
- Change CSS for logged in users
- Always the Latest google jQuery instead of default WordPress jQuery
- Add a jQuery Function
- Option Tree integration of Custom CSS
- jQuery does not work
- using jQuery on only one page
- Can’t call Javascript function – scope?
- Changing parent element’s class or style
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- echo custom fields with AJAX
- Adding jQuery datepicker to Custom Post Type Metabox [closed]
- In jquery use php variable to execute an enqueued jquery file
- Turn get_posts as string into an array for use in theme admin options
- Run a jquery script on on a certain template page
- How to stop media_sideload_image from running when deleting a post?
- Add php code to wp_print_scripts?
- Possible to hook into Media Library preview File column and use a custom image?
- How can i unload effect.min.js file?
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- Show some menu sub items as dropdown under a menu item
- $_Get and &_REQUEST Index Undefined on Functions.php
- Where is this JQuery coming from?
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- call_user_func_array() expects parameter 1 to be a valid callback, function
- Adding theme option values as custom body class
- How to load jQuery in TOP of wp_footer?
- Passing Jquery value to WordPress function
- WordPress can’t get jquery/unslider to work
- Add loggedout class on body using a function or JS
- Are innerHTML elements visible to jQuery functions?
- Include Jquery libraries in wordpress theme?
- Function that prevents users from uploading photos more photos
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- get content from page through AJAX
- Creating multiple category drop down
- How to setup a popup registeration page in wordpress with function.php
- colorbox not loading in
- How to add php within jquery
- Help with IF has focus then… statment
- How to add or delete default value theme options while activate and deactivate theme
- Get URLs for AJAX Filter Checkboxes WordPress
- wp_set_object_term via js btn frontend
- Is it possible to limit number of files a non-admin user can upload via the WordPress media library?
- Populate Product Regular Price with a calculated ACF Field Value
- iOS and ajaxComplete