0

I'm wondering if someone can help me with this. The theme I am working on has a custom theme options page where you can select various colors for the website. The problem is that the stylesheet it produces loads before the bootstrap and main stylesheet in header.php. I need this to load after those two. Is this possible to do?

2
  • Have you read about stylesheet dependencies (another explanation)?
    – fuxia
    Aug 22, 2014 at 18:54
  • Doesn't work for me. I think it's because the various color stylesheets are being enqueued from my theme-options.php file instead of the functions.php file. Aug 22, 2014 at 20:44

1 Answer 1

-1

Found a solution. I just added a number at the end like this..

add_action( 'wp_enqueue_scripts', 'moana_enqueue_color_scheme', 789 );

1
  • 2
    That'll work too, as that number is actually the priority in which the callbacks are rendered in an action hook. But, you'll need to create separate callbacks for each of your stylesheets and use priorities accordingly. The best way is using the stylesheet dependencies, which gives you much more control over the enqueued scripts and stylesheets.
    – Abhik
    Oct 23, 2015 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.