Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Justin Sternberg

    (@jtsternberg)

    Hello,
    Do other fields/metaboxes registered with CMB2 work for you? Also, is the CMB2 plugin active?

    Thread Starter wpexthemes

    (@wpexthemes)

    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

    Best regards

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    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.