You can use the WordPress Settings API to do what you’re looking for.
You can follow this – WordPress Settings API Tutorial ( www.ottopress.com ) to setup an options page, and depending upon the options saved in database you can show different content.
Example –
<?php
// get the stored value in variable - foo
$foo = get_option('option_name');
if ( $foo == 1 ) {
echo 'check box in CHECKED';
} else {
echo 'check box in NOT CHECKED';
}
Update –
Yup there’s Options Framework plugin plugin which can be used for this purpose.
The Options Framework Plugin makes it easy to include an options panel in any WordPress theme. It was built so developers can concentrate on making the actual theme rather than spending time creating an options panel from scratch. It’s free to use in both commercial and personal projects, just like WordPress itself.
– A Quote from plugin’s description
Related Posts:
- How To Determine If A Filter Is Called In A Sidebar/Widget Context?
- Adding a widget programmatically
- Override dynamic_sidebar() in plugin?
- Flickr plugin that will display photos from multiple group pools? [closed]
- I need some direction on how to have a sidebar based on meta rather than page
- Multisite Widget/Content
- Missing argument 3 for wp_register_sidebar_widget()
- Custom random quote widget breaks when used in multiple sidebars
- Best practice for including plugin output in a template without using shortcode?
- Widget’s container?
- Widget content turns up before title
- Listing all sidebars
- Co-author plus: list of posts by authors in the sidebar
- Cannot access variables within a widget
- twitter widget loads properly in all themes except my own theme?
- Template from scratch: Sidebars not showing widget
- What method should I use for a sidebar widget that reads latest posts?
- Can’t edit Contact Us form on front page
- Problem since update 3.5 [duplicate]
- Call plugin with php function
- How to disable a widget when dependent plugin is inactive?
- Sidebar widget: Randomly select text from a given set
- How do I use add_action on custom widget?
- How can I delete a wordpress widget instance?
- Repeated Output in Widget
- Exclude posts from widget while post is showing on home, single and categories
- Custom widget doesn’t save values from dropdown box
- Register Script in Plugin Widget
- WordPress Apply filter in plugin causes 500 internal error
- Add Shortcode tag in Widget/Sidebar
- How to create wordpress widget that is fixed position on the home page
- Saving widget options from class method
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()
- Short messages widget [closed]
- How do I add the same contact form to multiple wordpress sites and capture the response in one place or database?
- Add SideBar/Widgets Just Below the Post
- PHP Warning: Declaration of aec_contributor_list::form() should be compatible with WP_Widget::form($instance)
- Creating a widget and missing jQuery
- jQuery Click event is not fired at all
- strange shortcode error: does shortcodes requires any dependency?
- All custom widgets are not showing in widget area at the same time
- Widget for specific category
- Plugin showing error
- get_term_meta returns false in widget
- WordPress Widget Not Saving Instance
- Posts to have category specific sidebars with the widgets
- How to set the default value as the saved value once a form of widget is saved?
- How to Use the Filter “sidebar_login_widget_form_args”
- Woocommerce product info in a sidebar?
- My widget won’t update its values when save is clicked
- How to display a widget on a page with no theme?
- Add Stack Exchange Recent Questions to a wordpress sidebar?
- Widget where it can make changes to the container
- Accessing widget information
- Need to setup grid like thumbnail of recent posts on sidebar
- Extend a plugin to include a widget option
- Is there a Image Gallery which will load all my posted Images like twitter’s image grid?
- Displaying number of drafts in Posts section of admin sidebar [closed]
- Setting text widget to one page only
- How to add captcha to publish widget
- Modify pages widget and make a plugin?
- wp_footer hook running twice
- jQuery slider widget similar to cnet.com
- Why aren’t my Follow Me links working?
- Is there any plugin to show number of clicks on the link?
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- Unable to locate inline CSS causing parts of page to be blank
- Table of contents (TOC) plugin is not showing header tag
- co-authors plugin – inline listing
- Widgets are not displaying in the admin panel
- Elementor pro page editing gives error There has been a critical error on this website. Please check your site admin email inbox for instructions
- How can I display selected content from a seperate database in an Activity style widget?
- Can I add Short Code Of A Plugin In The Code Editor of WordPress?
- How to fetch WordPress database values in JavaScript widget
- Adding custom post category to categories widget
- RSS Feed on WordPress showing code (hypertext) in articles titles
- Mobile Menu and Mobile Sidebar missing
- Change language in SiteOrigin Widgets
- elementor development – custom widget like an inner section widget
- Update widget values from ajax function
- The styles in the recent posts widgets plugin not working
- Some Widgets in the Right Side Bar and the whole Footer section is not working in a WordPress Site
- What is the right way to populate a dropdown from MySql?
- Using foreach loop for `$instance` of form and update array widget iteration
- How to disable a widget area of a specific page?
- One time call to external API in widget
- Change WordPress plugin widget `id_base` without breaking widget
- Shortcode generated widget to appear on same line as heading text and button
- How do I keep children of certain parent menus expanded by default on a sidebar?
- Widget display in theme
- Registered sidebar area is not shown from plugin.
- Widget logic using woocommerce product category
- Custom content per post in widget
- Using slightly modified widget
- Hook on widget context plugin to add custom context for widget
- How to display widget in front end?
- Widget outputs the value but doesn’t save anything inside the textarea
- How to add styling and script to a custom widget plugin
- WordPress Widget: Is it possible to make the form dynamic without updating?
- Using Widget Logic to place menu on multiple pages?