How Can I Register Menus and Widgets Conditionally Based on Theme Options/Settings?
Below is the code you need. Your issue could be that you’re not first setting up the variable $display_options to contain your options, or that you not asking if the option is set. add_action(‘widgets_init’, ‘arphabet_widgets_init’); function arphabet_widgets_init() { $options = get_option(‘muffin_options’); if(isset($display_options[‘header_layout’]) && $display_options[‘header_layout’] == ‘1’) { register_widget(‘arphabet_widget_1’); } if(isset($display_options[‘header_layout’]) && $display_options[‘header_layout’] == ‘1’) { … Read more