• Resolved Josh Levinson

    (@joshlevinson)


    Coming from a theme perspective, I think it would be nice to have an option in wp_enqueue/wp_register_style to allow for the specified style-sheet to be loaded last. I realize that the functions already have the “dep” parameter to allow for an array of dependencies, but this is obviously not a solution to my request as one would have to load in each registered sheet they wanted to override, including new ones as plugins are added. This problem has recently come to my attention as the need to add !important declarations in many of my rules has become an issue, specifically in the case of overriding plugin styles (like Gravity Forms).

    This request could possibly be answered by answering this: In what order are styles queued, apart from the “dep” parameter? Do they have any semblance of a priority?

Viewing 2 replies - 16 through 17 (of 17 total)
  • Every theme that I’ve seen, including the default Twenty Eleven and Twenty Twelve, set up the themes stylesheet the way that I have shown. And if you’re going to quote those points, you really should have looked at the last point in that list:

    Themes may optionally link the default stylesheet (style.css) directly in the document head, or via wp_enqueue_style(). Whichever method is used, the default stylesheet must be referenced via get_stylesheet_uri()

    That spells it out plainly that it’s also acceptable to do it this way – which will solve your problems.

    As much as I understand that there is only one theme active at a time, there’s no feasable way to block a function from being used in a plugin. Functions can be called from anywhere so trying to block functionality something’s not called from a theme is going to be extremely hard, if not impossible. That’s why a theme-only function will not work, and will only add more complexity to the code base.

    Thread Starter Josh Levinson

    (@joshlevinson)

    *Sigh* It seems I let my frustration get the better of me in my quest for the answer I wanted to hear! ?? Good find with the fine print on that page. You are correct in saying that this will solve my problems! Thank your for your attention to this thread and your good answer(s).

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘WP Enqueue/Register Styles Feature Request’ is closed to new replies.