I tried a lot with using bootstrap to show the WordPress theme options page to appear in grid view. As we do col-lg4 and so...
I added add_editor_style(); for bootstrap, nothing happened.
The only table works there. I just want to design the theme options page to look good for the admin by using the full space available as well as responsive.
If I want to use bootstrap, how to do that or any other better way for the same.
I tried a lot with using bootstrap to show the WordPress theme options page to appear in grid view. As we do col-lg4 and so...
I added add_editor_style(); for bootstrap, nothing happened.
The only table works there. I just want to design the theme options page to look good for the admin by using the full space available as well as responsive.
If I want to use bootstrap, how to do that or any other better way for the same.
Share Improve this question edited Jan 2, 2020 at 14:08 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Jan 2, 2020 at 14:00 webfuelcodewebfuelcode 212 bronze badges1 Answer
Reset to default 0If you're building a custom menu page for your theme options, then you can first use add_menu_page()
to register the menu page. Then to use custom styles and scripts on that page, you need to enqueue them on admin_enqueue_scripts
action.
Something along these lines,
function my_enqueue_admin_assets() {
$screen = get_current_screen();
// only enqueue assets on the custom page
if ( empty( $screen->id ) || 'your_custom_menu_page_slug' !== $screen->id ) {
return;
}
// wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' );
// wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false );
}
add_action( 'admin_enqueue_scripts', 'my_enqueue_admin_assets' );
So enqueue the Bootstrap styles with the above code and then use the appropriate css classes on the markup you write for the add_menu_page()
callback.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744865194a4597936.html
评论列表(0条)