Title: On/Off button Control in functions.php
Last modified: August 21, 2016

---

# On/Off button Control in functions.php

 *  Resolved [sakarya](https://wordpress.org/support/users/sakarya/)
 * (@sakarya)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/onoff-button-control-in-functionsphp/)
 * Hello..
 * I’m tring to using OptionTree framework. But, I need help.
 * I created custom post types and I want to control them with theme options panel.
 * If user want to use one of them, he must activate it from options panel, but 
   I can’t control it. For control using on/off button.
 * Functions.php: [Functions.php](http://pastie.org/9142617)
 * How can I check the button is on or off?
 * OptionsPanel works very well.
 * Thanks.
 * [https://wordpress.org/plugins/option-tree/](https://wordpress.org/plugins/option-tree/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/onoff-button-control-in-functionsphp/#post-4881685)
 * The on off switch is either set to `on`, `off`, or `null`. You wold need to add
   an if statement checking if the value of your theme option is equal to `on` and
   then add your custom post type.

Viewing 1 replies (of 1 total)

The topic ‘On/Off button Control in functions.php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/option-tree_363534.svg)
 * [OptionTree](https://wordpress.org/plugins/option-tree/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/option-tree/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/option-tree/)
 * [Active Topics](https://wordpress.org/support/plugin/option-tree/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/option-tree/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/option-tree/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/onoff-button-control-in-functionsphp/#post-4881685)
 * Status: resolved