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
- Checking if a file is already in the Media Library
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- How can I track active users of my plugin? and why doesn’t WordPress.Org offer this?
- What’s the Right Way to get and save remote data for a Gutenberg block?
- Passing array of strings to a SQL statement in a WordPress plugin
- Add multiple shipping rates from add_rate function with custom ID
- Filter, or any way to dynamically change theme screenshot image?
- On Plugin Activation, How Do I Check for Proper Transport Mechanism?
- How do I dynamically render an InnerBlock inside a dynamic block?
- How can I limit the amount of characters used for description in the manage categories grid?
- Asynchronously render shortcodes in TinyMCE visual editor
- Open modal when user clicks on span in visual editor
- How to paginate a custom page template with custom database tables
- Bypass product key [closed]
- Return conditional category in load_posts_by_ajax
- About a programming language starts with [closed]
- Custom Block Not Shown in Block Inserter
- add_filter postbox_classes multiple post types
- How to Run Plugin on Server Without Web Browser
- Impossible to declare box-shadow with wp.customize?
- SASS not showing in customized preloader plugin
- WP Refused to display ‘URL’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’
- delete category on plugin deactivation wordpress
- Rate limiting ajax requests in WordPress
- How to filter an action inside class in MemberPress plugin?
- how to retrieve post_id under woocommerce_add_to_cart_validation hook?
- Define a url for an email confirmation from within a plugin
- WordPress Search Form with Keyword Suggestion
- WordPress custom plugin developement
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- ouput buffering confusing me!
- append code after the_content not working
- check wp_login into a plugin
- Anyway to prevent admin from seeing other admin’s product?
- Build a dynamic block using the default attributes
- Bulk post approval and publishing doesn’t work
- Show Admin Menu