Have you seen the documentation, specifically the Basic Usage doc? Or the Box Properties doc? I think you’ll find the answer there, but let us know if not.
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, 4 months ago by
joediego.
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
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/
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.