hook into init action on your initial plugin function
add_action('init', array(__CLASS__, 'your_function_within_class'));
and add the function
public static function your_function_within_class()
{
wp_register_style('myfirstplugin-admin-css', '/wp-content/plugins/myfirstplugin/assets/style.css', false);
wp_enqueue_style('myfirstplugin-admin-css');
}
hope this help
Related Posts:
- Using wp_add_inline_style without a stylesheet
- How important is it to enqueue a theme’s stylesheet?
- Why is wp_head() creating a top margin at the top of my theme header?
- Enqueue a stylesheet for login page and make it appear in head element
- Caching and Versioning for rtl.css
- Why I can’t add a CSS style in this WordPress theme?
- How to control initial wp_head() output?
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- How can I get wp_head() as a string instead of echoing it?
- Adding customizer styles with wp_add_inline_style
- What can I hook into after_setup_theme?
- Identifying the priority of style.css so I can make a small CSS file load last
- use add_action(‘wp_head’) in a widget for generating dynamic CSS styles
- Adding inline styles from a widget
- The best way to add stylesheets to WordPress
- Advantages of using instead of wp_enqueue_style()?
- How to add dynamic inline style?
- Enqueued Stylesheets Effecting Admin Styles
- wp_head() not inserting the default stylesheet style.css
- De-registering parent style sheet css recommended?
- enqueue_style is not working
- Dequeue a style file which is making website load slow!
- Is my approach to enqueue styles inefficient?
- Child theme style.css versioning
- Why wp_head() function not loading style.css?
- Disable wp_enqueue_style for theme on wp-admin
- functions.php not hooking up with style.css
- How can I let templates choose which stylesheets are enqueued?
- Stylesheet not linking
- Theme Loading Into Dashboard
- How to check if a WordPress core block is active in sidebar
- Font Awesome 5 Free – far working but fas is not? [closed]
- How remove render blocking css from wordpress when you build a theme?
- What is the safe way to print tracking code / pixel code before tag or tag
- How to modify default controls in WordPress theme customizer
- filemtime(): stat failed warning within a child theme
- How do I use a color from theme options?
- How to remove ID’s from wp_enqueue_style?
- Ideal inline dynamic CSS injection
- How to include a file only on dashboard widgets page?
- Having issue with WordPress wp_enqueue_style
- theme style is applied on the dhasboard rather than the website
- Are there any caveats to compiling all of my theme’s SCSS into the style.css file in the theme root?
- How to use Canonical URL meta tag to avoid duplicate content issues with WP home pages
- Adding google fonts to WordPress theme
- Displaying front side empty with one file attached problem
- Find out the reason that the Styles and scripts in the theme are loading properly in localhost but Not in server after deploying
- Using wp_add_inline_style Inside a Template File
- Different stylesheet for different pages not working fully
- Enqueue script/style with multiple GET parameters
- Is there a way to prevent wp_head from outputting self-closing tags?
- When to use _e and __ for the translation?
- With WordPress themes, where do I store the images and files relatively?
- How to Include SVG sprites icons into the body tag? [closed]
- Why doesn’t /2013/01/ properly return January’s archives in archive.php?
- Excess White Space Above Admin Bar on Frontend Using Twitter Bootstrap
- Child Theme not loading parent CSS
- WordPress settings API error when checkbox unchecked
- How the WordPress sidebar works
- two tinyMCE editors in the same page
- Separated Comment from Post
- index.php is not loaded for single posts
- Theme Customizer not loading
- WordPress Customizer Control with React
- File Security Check in wordpress in index.php of theme
- how to implement wp_is_mobile on themes?
- Part of Menu Item Hidden on Header Menu
- Customize the previous_post_link output
- How to use get_template_part instead of include_once?
- Which file handles the block latest posts, I want to examine excerpt handling
- Menu item added in wp_nav_menu_items filter is never highlighted
- Warning: A non-numeric value encountered in theme functions.php
- How can I ping update-core.php with a script?
- “Add A Widget” button in the Customizer
- loading blank white screen of slide
- Set parent theme language with custom .mo files
- Change template if tag selected
- How to reverse engineer the Twenty Eleven background image uploader?
- WordPress Theme With Modified View
- jQuery from parent theme loaded with many other scripts in a single min.js file
- Menu dispareing when visititing current page [closed]
- Allow filtering of loops for all categories
- What Can I do To Achieve this Effect: WIP -> Portfolio
- Trying to link to a php template file but its blank
- Twentytwenty theme p-tags break em- and strong-tags that span several paragraphs
- Image cropping isn’t working correctly when using Offload Media
- Can any IDE (eg PHPStorm, VS Code) correctly show functions added via require get_template_directory() string results?
- Array for WordPress Avatar Size and Class
- Template for front page (latest posts)
- How to toggle WP Customizer Panel and Section with JavaScript API?
- is_active_sidebar() problem
- WordPress uploads do not show up and I see the white screen of death in some cases
- How to fix an issue with customizer live preview?
- Code for creating three vertical columns in WordPress Bootstrap theme
- Image load issue with custom page template on Internet Explorer
- Custom widget not appearing on front end
- Adding custom widgets to theme sidebar on activation
- Permalinks problem with custom theme
- Purchased Theme to Custom Made Theme? [closed]
- How to make website with many template that active [closed]