I guess you’re using this code in a wrong file other than the main plugin file (usually /wp-content/plugins/wp-cricket-info/wp-cricket-info.php
). So, the file you’re referencing when enqueueing is actually incorrect.
Follow the steps below-
- Define a constant in the main plugin file that references the file itself.
define( 'WP_CRICKET_INFO', __FILE__ );
- When enqueueing the CSS, use that constant as the second parameter.
wp_enqueue_style( 'cricket-info-admin-styles', plugins_url( 'assets/css/admin_styles.css', WP_CRICKET_INFO ), false, '1.0.0', 'all' );
Related Posts:
- What is better way to use Bootstrap inside admin panel?
- how to add stylesheet to particular plugin only?
- Distributing Frontend Assets with Plugins
- Is it possible to load the css just on my plugin admin page?
- Enqueue a file that’s not js or css
- Twenty-seventy theme remove additional CSS from head
- How to override existing plugin action with new action
- Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1
- How to store username and password to API in wordpress option DB?
- Which hook should be used to add an action containing a redirect?
- Is it worth checking if class_exists when developing a plugin and how to do it?
- Default table collation on plugin activation?
- the_content after all shortcodes are parsed
- How do I resolve Notice: Undefined offset: 0 in /wp-includes/capabilities.php on line 1145
- Category listing with thumbnail and description on home page
- How can the tinyMCE dom be manipulated (offical API does not seem to work)?
- Pass javascript result to shortcode executer function
- URLs of plugin resources?
- anything like add_meta_box for categories?
- Can we create a category list page in WordPress?
- How to include class from addon after to be sure one class exists in the main plugin?
- Developing a plug-in to charge for
- WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
- What is the Difference between directly call a function and call a function using add_action?
- Undefined function wp_set_password
- Updating my plugin without releasing a new version
- Is it possible to check is loaded language files correctly with WordPress plugin?
- 404 errors after plugin options update and category base change
- Default category got deleted. How to get it back as ID=1?
- How to determine, from plugin script, if active theme has The Post Title
- What allows a template file from plugin to be copied in child theme and overridden?
- add_filter : Passing an array instead of the callback function?
- creating custom archive template within plugin for custom post type using archive_template filter
- Advice on plugin structure
- Using wp_parse_args to set up Plugin Default Settings
- how to add Jquery script to one page?
- Problem with parameters in url and pagination
- get_posts() not working when accessing with a custom user role
- Trying to understand order and frequency of action hooks firing
- Where can i find wordpress auto update code flows?
- Create & Save multiple Meta-boxes
- Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?
- Can’t get woocommerce_get_price_html to work [closed]
- jQuery selectors for editor elements safe to use?
- wp_set_object_terms not updating database without a die()
- WordPress form action – doesn’t work
- How to fetch only current hour posts?
- Plugin sub-menu pages recommended structure and links
- Fatal error: Uncaught Error: Call to undefined function get_option()
- template_redirect or admin-ajax.php?
- how to get all the child category name in a specified category name?
- Widget HTML Display Problem
- Can I add custom css to an mu-plugin?
- Change WooCommerce Email Header using custom plugin
- How to get the current page Title and Page URL in footer.php
- my own SVN for a plugin/theme
- How to add search form in main page body?
- Activate theme via plugin script?
- How can I add function calls to my plugin’s options.php default submit routine?
- Need help about understand api, wp, $ syntax in WordPress plugin script
- Secruity Questions on a timer
- How to rename the plugin PHP file without affecting existent users?
- Add location tag to wordpress posts
- Open tab on current day problem jQuery and WordPress
- Plugin working on my local installation but Cannot be activated online
- Load php file with jquery in single.php
- WordPress Page Reload Takes forever during theme development
- Why is the expected file not being deleted?
- How to determine which capability to use?
- How to add some basic inline CSS using existing plugin or theme?
- How does one update complex options?
- How to highlight a page in the page list (Admin Menu)?
- Forbidden Error in ajax call with wordpress
- How to use setAttributes outside of the edit function return
- WP plugin svn checkout 429 error “Too many requests”
- WordPress Filesystem create CSS-File – get Shortcode ID for Name
- How to add admin.php to WP Admin Menu Link
- How to get access the ID of all posts of custom post type in Gutenberg editor
- Use admin-post to submit form data to external database
- Custom recurrence not working / Wp Cron event
- Single_template for a custom post type created from a plugin is returning an empty page
- How to retrieve custom profile fields associated with different users
- How to embed or integrated a custom WordPress Widget into the theme?
- Confusing $tag specification for apply_filters call, in core options.php code
- create post of acf frontend not published and not trashed
- Is there a general way to get a themes primary colour?
- Why is ‘register_activation_hook’ undefined?
- Redirections the right way inside a plugin directory
- How to Register/Link to .js Files in WordPress Dynamicaly in Header.php
- Thumbnails for media Library images
- How to specify widget order or css name via script?
- How to view plugin ratings?
- get_categories exclusion issues
- Best Way to Inventory the Media Library of a 200+ Multisite Installation?
- Apply function on all action hooks?
- Getting Plugin directory and url
- i want to auto create pages with shortcode when plugin is activated and delete when deactivated
- Insert meta-description into Yoast-SEO input-field via JavaScript
- Loading all PHP files all the time or only when they needed in Custom Plugin Development [closed]
- Showing Home option in dropdown when there is no Home page exist