You need to modify this a little bit.
class Organiser extends WP_Widget {
...
function __construct() {
add_action( 'wp_enqueue_scripts', array('Organiser', 'register_plugin_styles') );
...
}
public function widget( $args, $instance ) {
wp_enqueue_style( 'organiserStyle' );
include(dirname(__FILE__)."/organiserWidget.php");
}
static function register_plugin_styles() {
wp_register_style( 'organiserStyle', plugins_url( 'organiser/css/organiserStyle.css' ) );
// wp_register_style( 'organiserStyle', plugin_dir_url( __FILE__ ) . 'css/organiserStyle.css' );
// wp_enqueue_style( 'organiserStyle', plugin_dir_url( __FILE__ ) . 'css/organiserStyle.css');
}
...
}
Related Posts:
- how to include other plugins css files in a shortcode?
- How can I dequeue a Plugin Stylesheet?
- wp_enqueue_style in Plugin [duplicate]
- Prevent CSS/JS loading when plugin is not used
- wp_enqueue_style specifics for overwriting plugin styles
- How to add CSS via custom plugin?
- Dequeue, Unregister, Remove Action – Not Working on Plugin
- Custom CSS not being added by plugin
- Load CSS before Theme CSS
- Passing a parameter to filter and action functions
- Best way to overide plugin CSS?
- Get a list of all registered actions
- How can I edit post data before it is saved?
- How can I use WordPress functions in my stylesheet?
- How can I see all the actions attached to an “add_action” hook?
- Where is the best place to use add_filter
- Restricting a Plugin to Only Load its CSS and JS on Selected Pages?
- How do I cleanly override a plugin’s CSS with a child theme?
- How do I force wp_enqueue_scripts to load at the END of ?
- Deactivate plugin for a specific user group
- Auto Load Plugin Hooks inside Must Use Plugin
- How to only hook on Single.php after content?
- Why does wp_enqueue_style() in plugin not load stylesheet?
- Removing an action from an external plugin class
- When can you get current page ID and initialize hooks right after?
- How can I log a user out of WordPress before the page loads?
- How can I reduce the amount of files loaded/included per plugin?
- What is the ‘admin_action_’ . $_REQUEST[‘action’] hook used for?
- Autogenerate wordpress shortcodes using array?
- WordPress admin notice in plugin function
- Using the ‘draft_to_publish’ hook (post status transition)
- Using standard backend elements in Plugin
- Using tabs for wordpress plugin
- How to load different css file for different pages
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- How can I limit functionality in one version of a plugin?
- Is there a global action for when a plugin is uninstalled?
- Get info (url) from already enqueued styles
- Shortcode display outside the div
- Override CSS settings of plugins
- Which hook callback has priority if both plugin and theme use the same hook?
- How can I make content disappear when a user logs in?
- Add CSS animation as Preloader to WordPress
- Best way to inject css into admin_head in plugins?
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- Quote rotator in the sidebar
- Plugin throws up 404 on front-end when when enqueuing style with filetime
- Use external link in the add sub menu
- Styles and Scripts, Selectively enqueue across entire site
- Make the css of the widget overwrite theme css
- How to remove action from plugin?
- delay function on publish?
- Very stubborn wp_register_script / add_action vs remove
- How to prepend to the_title for admin-side plugin’s use
- Add custom buttons with custom actions in Edit Post screen in WordPress?
- WordPress Plugin Look & Feel
- Add CSS class to add-to-cart button, Woocommerce [closed]
- do_action and hook methods
- Can a plugin add to header/footer/body content?
- Is it possible to add an action to the currently running action?
- Is there an action that is called when a post is restored from the trash?
- How to load all plugins CSS after child theme CSS?
- I need to generate the CSS for my plugin from a function, how do i map a request to a function in the front-end?
- How do I register a stylesheet inside a WordPress widget?
- How to filter content post only on save
- Override Theme CSS with CSS from a plugin
- Filter or action hook to insert content on admin pages before tag
- Is it possible to remove this action? (as it’s added just before it’s called)
- Styling readme.html in plugin?
- Unable to load stylesheets and scripts to plugin settings page
- Layout shop page: resize images and columns
- Action on post publish
- How to add inline css/js inside a shortcode
- WordPress Plugin Boilerplate – add_action hook in static “activate” function
- How extend shortcode default values for a plugin?
- How to call bind function in wordpress actions or hooks
- How to prevent action in ajax request, when in admin side?
- What is the purpose of $merged_filters?
- template_redirect not being called when using ajax
- How to override my plugin’s php classes with duplicates that are in my child theme folder
- filemtime() warning when enqueuing style within plugin
- Is it possible to use Snap Scrolling? [closed]
- Image resizing on home page (product category) [closed]
- add action wp_head not working
- Can I use a method from an existing plugin as an action hook?
- Plugin custom Action Hook not working
- How to enqueue a theme style-sheet to my admin settings page?
- What are the benefit in adding hook in the init() hook?
- add_action in functions.php, do_action in plugin?
- Detect when any plugin is activated or deactivated
- W3 Total Cache: Load CSS asynchronously for better PageSpeed score? [closed]
- Removing an action, or dequeueing style – Both not working
- add action for displaying posts using a shortcode
- How do I write into a file (css)
- ‘wp_login’ action hook not working with wp-login.php file
- Is it possible to enqueue CSS files from plugin before theme’s CSS files?
- ‘Customize’ button in admin bar for CSS
- Where to hook my plugin’s action
- Why isn’t “background-image: url”working with Bootstrap carousel on WP?
- How to add page using HTML, CSS and JS?