Title: Theme option code not working
Last modified: May 9, 2018

---

# Theme option code not working

 *  Resolved [wpexthemes](https://wordpress.org/support/users/wpexthemes/)
 * (@wpexthemes)
 * [8 years ago](https://wordpress.org/support/topic/theme-option-code-not-working/)
 * Hello guys!
    I have used this example code to create theme option: [https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/theme-options-cmb.php](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/theme-options-cmb.php)
   But when i try to add it into functions.php file i did not see any theme option.
 * could please let me know what if i am wrong ?
 * Best regards

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Justin Sternberg](https://wordpress.org/support/users/jtsternberg/)
 * (@jtsternberg)
 * [8 years ago](https://wordpress.org/support/topic/theme-option-code-not-working/#post-10262898)
 * Hello,
    Do other fields/metaboxes registered with CMB2 work for you? Also, is
   the CMB2 plugin active?
 *  Thread Starter [wpexthemes](https://wordpress.org/support/users/wpexthemes/)
 * (@wpexthemes)
 * [8 years ago](https://wordpress.org/support/topic/theme-option-code-not-working/#post-10262983)
 * Hi,
    Thank you for reply. I have included example-functions.php file and it is
   working normally when register metadata for page, but when i try theme option
   example code, it is not working. I also try this code to add example option for
   Settings > General and it is working fine: [https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/add-cmb2-settings-to-other-settings-pages.php](https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/add-cmb2-settings-to-other-settings-pages.php)
 * Best regards
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [8 years ago](https://wordpress.org/support/topic/theme-option-code-not-working/#post-10263079)
 * Just to be certain, do you have this line as well?
 *     ```
       add_action( 'cmb2_admin_init', 'myprefix_register_theme_options_metabox' );
       ```
   
 * I just added this to my twentyseventeen local theme and hit save, and it created
   a top-level menu item in the admin. Not sure what may be going on for your case
   at the present moment.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Theme option code not working’ is closed to new replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

## Tags

 * [theme option](https://wordpress.org/support/topic-tag/theme-option/)

 * 3 replies
 * 3 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/theme-option-code-not-working/#post-10263079)
 * Status: resolved