The above looks correct, however, you need to specify your script to enqueue after bootstrap by adding the bootstrap-min
handle to the third, dependencies parameter.
function register_css() {
wp_register_style( 'bootstrap-min', get_template_directory_uri() . '/css/bootstrap.min.css' );
wp_register_style( 'custom-css', get_template_directory_uri() . '/css/custom.min.css', 'bootstrap-min' );
wp_enqueue_style( 'bootstrap-min' );
wp_enqueue_style( 'custom-css' );
}
add_action( 'wp_enqueue_scripts', 'register_css' );
See wp_register_style for more.
Alternatively you can, if you know you need to enqueue the files immediately from within your callback function, use wp_enqueue_style
just like wp_register_style
, see: wp_enqueue_style
Related Posts:
- Why is style.css not being enqueued?
- How to enqueue style before style.css
- The correct way to include JavaScript and CSS in my WordPress Themes
- Relative path in wp_register_style not working
- How to reference different css (bootstrap) stylesheets for the header and body of a page?
- Bootstrap 4 Optimization
- Custom theme – Bootstrap CSS not loading via wp_enqueue_style or otherwise
- What is the difference among col-lg-*, col-md-* and col-sm-* in Bootstrap?
- Does bootstrap have builtin padding and margin classes?
- How to set up fixed width for
? - How to change btn color in Bootstrap
- Bootstrap 4, How do I center-align a button?
- Responsive Bootstrap Jumbotron Background Image
- Changing the width of Bootstrap popover
- Flushing footer to bottom of the page, twitter bootstrap
- Bootstrap change carousel height
- How can I make Bootstrap columns all the same height?
- Set bootstrap modal body height by percentage
- Bootstrap align navbar items to the right
- In a bootstrap responsive page how to center a div
- Responsive Canvas in Bootstrap column?
- WordPress Admin Bar Overlapping Twitter Bootstrap Navigation [closed]
- Inbuilt style for jquery-ui-datepicker
- How to conditionally enqueue a stylesheet only for a certain page(s)?
- What is the correct way to enqueue multiple CSS files?
- Remove wp_add_inline_style
- Avoid to load default WP styles in login screen
- Use wp_enqueue_scripts, not wp_print_styles?
- How Can I Use A Child Theme Effectively When Parent’s CSS Is Located in a ‘CSS folder’?
- WordPress Register Style Called Incorrectly
- Disable child theme css on certain pages
- Style.css in child theme is loaded before Bootstrap
- When enqueing a stylesheet, is it possible to remove the type attribute? [duplicate]
- Enqueue style for Password Reset page
- Relative path instead of absolute for wp_enqueue_script
- get_stylesheet_uri returns wrong path
- Override load-styles.php with admin screen css
- CSS file not registering through add_action
- Custom Admin CSS styles to style media uploader?
- getting url in wp_enqueue_style
- How the Css File is Linked without calling it in header.php?
- Changes in enqueued / registered stylesheet paths not updating—why?
- Loading different stylesheet on WordPress pages?
- Use wp_add_inline_style to add code to before wp_head?
- why enqueued styles in header.php shows in footer?
- How to insert html/css/javascript code to wordpress plugin
- Redoing home page but changes not taking effect
- Different ways to load child theme css
- How to enqueue a random css style?
- How to override Bootstrap css with my child theme css in wordpress?
- Layout using Bootstrap not aligning correctly
- Enqueue styles in new site editor in WordPress 5.9
- Bootstrap in theme
- How do I view registered syles and scripts for enqueue
- How do I make header.php use different css for different pages?
- Load CSS in footer, like your can with JS?
- CSS – Initial HTML Margin Issue On WordPress Site
- Child Theme CSS not showing at all
- Faster fonts on mobile
- Split Media Queries in different files!
- Style file inclusion
- Display Something in the Header After All Styles are Loaded
- My CSS suddenly doesn’t load anymore [closed]
- How can I force Dynamic CSS via ACF values to update on page load?
- functions.php – inject inline css from file
- How to remove the gap on right side of webpage (using Bootstrap with WordPress)?
- Append style tag in head while shortcode runs
- How can I move my custom css to the very bottom of the head section?
- CSS getting injected into index from somewhere after theme/custom CSS is loaded, overriding all of my CSS [closed]
- enqueing Javascript and CSS
- Including CSS files in HEAD based on page content
- All of my custom Bootstrap styles are not working in my child theme!
- How to integrate Bootstrap Grid System in WordPress
- How would one set or override a Fallback font for characters in second language?
- First element/selector of enqueued CSS file breaks
- Use conditionals with wp_enqueue_style to attach stylesheet according to post type displayed
- Modal dialog under the backdrop
- Dequeue styles with query doesn’t work
- Save custom option in CSS file
- How to enqueue stylesheets in child-theme functions.php?
- Add inline CSS to login page with wp_add_inline_style
- Bootstrap Integtration
- Set different css stylesheet for specific pages [duplicate]
- My Child Theme CSS Isn’t Working
- How to disable all css from the theme for a specific post type page
- Font size decreases when child theme is created from parent theme?
- Bootstrap News: Image Modifciation
- Can’t center post thumbnail with bootstrap [closed]
- Controling css order
- Modify arguments for parent theme’s `wp_register_style` via child theme
- Why are my parent styles loading after my child styles?
- Replacing parent theme’s IE-specific CSS
- Browser stacks different versions of style.css
- Parent style messing up with Bootstrap [closed]
- Bootstrap navbar-fixed-top issues [closed]
- How to make this splash page responsive
- How to create my own style.css file in an wordpress child-theme
- Enqueue MCE Editor CSS in admin page
- plugin not loading my css and js
- How enqueue CSS out of theme folder?