First issue – you have dependency backwards. Depending on something means loading after dependency, while you want earlier.
Second issue – theme’s stylesheet doesn’t actually use enqueue, it is usually codded directly in header.php
file of theme. And since it seems to come before wp_head()
call – you have no hook to ensure your stylesheet is above it.
So this is commonly handled like your workaround – queued stylesheet with option to disable it by code or option in admin.
Related Posts:
- How do I add CSS options to my plugin without using inline styles?
- Is it ever okay to include inline CSS in plugins?
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- Build path for a custom portfolio plugin
- Displaying search results in the widget itself?
- How to prevent loading of all plugin’s resources?
- What is the best way to provide plugin users with a way to customized the styles
- Post from front-end with post types, categories and taxonomies
- Need specific kind of “Poll Voting” for WordPress [closed]
- What is better way to use Bootstrap inside admin panel?
- wp_enqueue_style built in styles
- Backslashes being stripped from CSS
- Dequeue theme stylesheets but keep widget styling on custom page template
- How to check if a stylesheet is already loaded?
- how to include javascript file and css file in wordpress
- How can I add a CSS rule to edit.php?
- Remove Internal Style Sheet if no Value Provided?
- How do I include background images in my stylesheets in a plugin?
- Best plugin for most viewed post [closed]
- Is there no admin ui guide for 4.x?
- Make WordPress cache permanent for some pages until edited
- Correct check for any admin page with editor
- best way to make a WordPresss multisite that is secure but at the same time supporting my plugin development efforts
- How to remove default style of header in wordpress metabox
- CSS not affecting widget output
- How can I avoid conflicts between plugin and theme?
- Plugin Development/ Stop CSS clashes.
- Can’t change the style of a submit input type? [closed]
- Make a plugin page out of influence of the theme’s style
- Distributing Frontend Assets with Plugins
- My stylesheets are not enqueuing
- Custom Plugin – CSS works, JS doesn’t
- Are there any official or unofficial guidelines for the styling of a widget?
- Proper way to include stylesheet for panels
- Apply styles to blockquote element with the WYSIWYG editor
- Styles don’t load correctly. Insecure content
- Completely isolate a plugin view so it doesn’t load the theme
- Secruity Questions on a timer
- Does WordPress default CSS have Grids?
- Best way to distribute templates and code accross multiple wordpress sites?
- How to insert HTML/CSS/JS into my iframe plugin?
- How To Protect Plugin Display From Being Affected By Theme’s CSS
- Load stylesheet in edit category page?
- CSS not being applied using wp_enqueue_style
- WordPress Plugin Authoring question about jquery and css
- Development plugin to view and manage scheduled wordpress cron jobs?
- How to add some basic inline CSS using existing plugin or theme?
- Why my theme’s css not working on another site
- WordPress plugin development theme issue
- Why does theme’s reset CSS have higher precedence of plugin’s CSS?
- Twenty-seventy theme remove additional CSS from head
- How to customize the size of Featured Images or Post Thumbnails in WordPress?
- Publish, Save Draft and Preview buttons do not work after being moved with jQuery
- Unable to link CSS file
- Pluigin Migration – I need to move a single plugin to a different website
- How can I add the Post ID to Class Name in Jquery?
- Let user override plugin CSS
- Practical Solutions to HTML5 Video on WordPress
- Best practice to include custom user styles in widgets
- How to change url’s in WordPress when changing domain [duplicate]
- How to Implement SAM Broadcaster with WordPress? [closed]
- How to create A – Z List with pictures?
- how to add contact form 7 shortcode in javascript variable
- Problem with inline style CSS properties issue on DIV
- How to give a NavWalker its own stylesheet?
- The Correct Way to Use Nonce Field without Settings API
- Special Formatting for WordPress Plugin Description?
- I am trying to make a page in the admin section similar to the appearance of the Profile page for users
- creating a plug in that would tap into save/update action of posts [closed]
- why do I have to use required parametres?
- Getting a WordPress Debug Strategy
- Include file in plugin file
- post_title is empty on global $post object
- Inserted double quote when prepending to the_content
- unable to wp_enqueue_script(‘suggest’);
- Plugin development – loading Javascript and Flash
- Meta box on options page save form problem
- Quasi-custom API Call Plugin
- Drawing the line between theme & plugin on large scale bespoke projects
- making a plugin that moves other plugins wp_head actions to wp_footer
- Using add_sub_menu to put into Appearance Section
- WordPress multisite,use same cookies across all website?
- How can I show posts for a single category?
- How to check via conditional tags for a single plugin page?
- my basic php code producing unexpected results
- HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?
- wordpress admin plugin menu custom css
- breadcrumb need to show all pages and subpages
- Check if post belongs to any category
- Mixing l18n string from my plugin with WordPress’ translations
- How to add search form in main page body?
- Can I use %category% like Templates in my Plugin?
- How to add custom options for plugin into the add post screen – like yoast seo
- WordPress – manually relate a post to page(s)?
- Menu page with minimum capability as ‘Subscriber’ doesn’t allow ‘Admin’ to access it?
- What’s wrong with my usage of add_filter
- Minimum Widget Width for Plugin Development
- Moving/dragging a metabox removes TinyMCE’s content
- Activate theme via plugin script?
- get author of published post