Title: Add field code example sidebar
Last modified: December 5, 2017

---

# Add field code example sidebar

 *  Resolved [joediego](https://wordpress.org/support/users/joediego/)
 * (@joediego)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/add-field-code-example-sidebar/)
 * how i can create sidebar with custom fields using CMB2?
    Example code..

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

 *  Plugin Author [Justin Sternberg](https://wordpress.org/support/users/jtsternberg/)
 * (@jtsternberg)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/add-field-code-example-sidebar/#post-9753152)
 * Have you seen the [documentation](https://github.com/CMB2/CMB2/wiki), specifically
   the [Basic Usage](https://github.com/CMB2/CMB2/wiki/Basic-Usage) doc? Or the 
   [Box Properties](https://github.com/CMB2/CMB2/wiki/Box-Properties#context) doc?
   I think you’ll find the answer there, but let us know if not.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [8 years, 6 months ago](https://wordpress.org/support/topic/add-field-code-example-sidebar/#post-9753183)
 * Also see the first part of my reply at [https://github.com/CMB2/CMB2/issues/1069](https://github.com/CMB2/CMB2/issues/1069)
 *  Thread Starter [joediego](https://wordpress.org/support/users/joediego/)
 * (@joediego)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/add-field-code-example-sidebar/#post-9753252)
 * I ‘m registred new sidebar with this code.
    `register_sidebar( array( ‘name’ 
   => __( ‘MY SIDE 01’, ‘rmcontact’ ), ‘id’ => ‘mysidebar’, ‘description’ => __(‘
   MYSIDE 01’, ‘rmcontact’ ), ‘before_widget’ => ‘<div id=”%1$s” class=”widget %
   2$s”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ‘<h2 class=”widget-titulo”
   >’, ‘after_title’ => ‘</h2>’, ) );
 * how i can create custom fields using CMB2 in my sidebar?
    -  This reply was modified 8 years, 6 months ago by [joediego](https://wordpress.org/support/users/joediego/).
 *  Plugin Author [Justin Sternberg](https://wordpress.org/support/users/jtsternberg/)
 * (@jtsternberg)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/add-field-code-example-sidebar/#post-9753262)
 * CMB2 does not do fields on the frontend of your site by default and is not technically
   a supported feature, though certainly possible with some knowledge of php. There’s
   a few snippets for outputting forms/fields on the frontend: [https://github.com/CMB2/CMB2-Snippet-Library/tree/master/front-end](https://github.com/CMB2/CMB2-Snippet-Library/tree/master/front-end)
 * But as I mentioned, it’s not technically a supported feature for CMB2, so you
   will be a bit on your own to implement it. If you have further questions for 
   that implementation, you might need to take them to [https://wordpress.stackexchange.com/](https://wordpress.stackexchange.com/)
    -  This reply was modified 8 years, 6 months ago by [Justin Sternberg](https://wordpress.org/support/users/jtsternberg/).
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [8 years, 6 months ago](https://wordpress.org/support/topic/add-field-code-example-sidebar/#post-9753349)
 * One thing to keep in mind is that this is regarding adding CMB2 fields to widgets,
   which is different than field display as a whole on the frontend, for which there
   are many examples available.
 *  Thread Starter [joediego](https://wordpress.org/support/users/joediego/)
 * (@joediego)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/add-field-code-example-sidebar/#post-9761085)
 * thanks giu uys

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

The topic ‘Add field code example sidebar’ 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/)

 * 6 replies
 * 3 participants
 * Last reply from: [joediego](https://wordpress.org/support/users/joediego/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/add-field-code-example-sidebar/#post-9761085)
 * Status: resolved