If 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.
Related Posts:
- Best way to include Bootstrap in WordPress
- Port existing Bootstrap site to WordPress?
- Loading Bootstrap with wp_enqueue_style and wp_enqueue_script
- Using twitter bootstrap in a theme
- How can I allow a client to edit certain parts of a static site?
- Convert theme to be based on Bootstrap?
- Is there a WordPress theme for twittstrap? [closed]
- Best Practice Jumbotron Image for WordPress ~ Responsive
- How to make a page extend full screen [closed]
- Using OOP in themes
- How can I allow the Editor Role to change Theme Settings?
- Undefined offset: 0 in > […] /wp-includes/capabilities.php on line 1067
- Editing Links in the Footer of WordPress Themes with Base64 Encrypted Code?
- How to set two different themes on one WordPress? (Desktop vs. Mobile)
- How can I add a set featured image function to a theme that doesn’t already have it built in?
- Display custom_background outside wp_head()
- register_theme_directory and broken deploys
- switch a theme different per user role
- How to make alert for new version on theme options?
- Can we create a child theme for a premium child theme built on Genesis framework?
- WordPress ignoring specified template for front page. Why?
- Migrating October CMS to WordPress
- Why are my sidebars not registering in unit tests
- Theme editor not showing correct index.php
- How to start learning CSS and theme development?
- How do I make the category template display full posts instead of partial posts?
- Does uninstalling a WordPress theme delete its database values?
- How to set a single theme directory on a multisite blog?
- PHP Parse error: syntax error, unexpected end of file, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) on line 230 [closed]
- Child theme not using parent theme css/styles/formatting?
- Create register form without a plugin
- Retina JS not working
- Get WordPress to use another custom “author.php” file (“custom-author-file.php”)
- wp_add_inline_style() not working?
- X-Axis of Site is Messed Up Because it is in Hebrew
- How to create my own sidebar in Twenty Eleven child theme?
- WP can’t create new directory
- style.css not reflecting changes. I have no cache installed
- Is it possible to create child themes using the WordPress Dashboard?
- Can I use wordpress themes without wordpress?
- Determing number the query ran by core wordpress
- Preserve theme settings when migrating from local to live
- Unable to access wordpress login.php [closed]
- Permissions for installing themes and files in general?
- Twenty Seventeen search error
- Protect shortcodes, custom JS, and CSS from theme updates
- Recommended Media Size for Twenty Fourteen
- for my current theme( own custom ) the default menu options are disabled in wp-admin?
- Most wp_nav_menu parameters ignored
- Free WordPress theme for an intranet tutorial site [closed]
- How do you remove a broken theme from WordPress Admin (without FTP or Cpanel)
- A wordpress site keeps editing wp-content files after migration
- Switching Theme and back will reset the previous Theme’s settings?
- Using Grunt and keeping theme comments
- Why are so many popular responsive WordPress themes “boxed” at 940px? [closed]
- Where did my Theme Editor go?
- Pages and posts on ElegantTheme featured slider [closed]
- Blackberry mobile theme redirection
- Child theme breaks after update of master theme
- Insert the current theme header into an external HTML/XHTML file
- How to use one git (github) repository for version control for multiple themes
- Fix warning: Missing argument
- My first WP development project – am I envisaging this right?
- How can I fetch the next level of the currently selected main menu (hierarchical menu)?
- I’ve got a theme I can’t update and won’t let go
- Make theme settings support multisite enabled (WordPress Mu) site
- Is there any way to modify images from a theme using the web interface?
- Removing basic header/text elements from a theme
- how to get json file in wordpress template
- sidebar in 2020 theme as a widget
- WordPress margin issues
- Remove style id inline CSS in WordPress
- How to find file that placed a line in my header
- Where to find child themes?
- how to create a section inside a section with theme options customizer
- WordPress thinks my custom theme is a theme in the public theme repository
- Warning: call_user_func() expects parameter 1 to be a valid callback
- Phone numbers showing same color as header [closed]
- Baskerville Theme – How to use the masonry grid layout on other pages
- Changing admin Textarea to integrated WP editor
- Line break no working on theme
- Style of a theme
- Orion theme (from theme forest) [closed]
- QA/Staging envirnoment for wordpress sites
- Diagnosing a connection reset problem
- Create /archive page in WordPress Theme
- Customising a theme
- Blog shows up without Theme/CSS styles
- Boldy theme – Regarding the images above the boxes
- Symbolic Links for themes – linking one theme to many wordpress installs
- Fatal error: Call to undefined function get_header() and BuddyPress [closed]
- which theme is this? [closed]
- JQuery Error in theme for .live is not a function [closed]
- How can I either move the nav bar down or create more space for the header? Theme – Ajaira
- To create a theme or use an existing one? [closed]
- Overwrite functions.php of a theme – What if the theme is updated?
- How to add/edit content Custom Content item in theme
- Why does WP theme not look like promoted? [closed]
- Remove image next to header image on WellExpo theme [closed]
- Adding PHP code to single template in 2023 edition of WordPress theme