Support » Developing with WordPress » Need help with WP enqueuing

  • Hi all,

    I have been looking at this too long and have had to find a fresh few eyes.

    Followed a guide to set up a WP theme… and I have managed to load the Bootstrap.min.CSS. For some reason my other Style sheet will not load, though when inspecting the page it clearly says it there in the <head>…

    Anyway I have made the site live for help. [ redundant link removed ] the function is;

    function load_stylesheets()
    {
    	
    	wp_register_style('stylesheet' , get_template_directory_uri() . '/css/bootstrap.min.css' , 
    					  array(), false, 'all');
    	wp_enqueue_style('stylesheet');
    	
    	wp_register_style('styles' , get_template_directory_uri() . '/style.css' , 
    					  array(), false, 'all');
    	wp_enqueue_style('styles');
    	
    	
    }
    add_action('wp_enqueue_scripts', 'load_stylesheets');

    any way, yes the Bootstrap is loading. but my Css is not.

    Please say I am missing something stupid lol

    Thanks ahead of time.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • First, I think you should give a unique name to bootstrap.css. Don’t use stylesheets as names to avoid you forgetting to register another stylesheet with the same name.

    
    wp_register_style('bootstrap-css' , get_template_directory_uri() . '/css/bootstrap.min.css' , array(), false, 'all');
    wp_enqueue_style('bootstrap-css');
    

    Second, for style.css you just to enqueque it. Use get_stylesheet_uri() instead.

    
    wp_enqueue_style( 'style', get_stylesheet_uri() );
    

    Hey, Thanks for the reply, Still hasn’t seemed to work. No CSS that i put into the style.css sheet gets pulled through.

    Hi, yeah I figured it out this morning.

    But now I cant seem to get bootstrap going lol

    So I’ve just been doing it the old fasiond way

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.