Here’s your problem:
wp_enqueue_style( 'style', get_stylesheet_uri() );
wp_enqueue_style( 'slider', get_template_directory_uri() . 'test.css', array(), '1.1', 'all');
Neither of those files are in your theme. get_stylesheet_uri
refers to the style.css
that has the themes name etc, and get_template_directory_uri
is the URL of the parent theme. Neither of those are your plugin folder.
You can confirm this by looking at the browser dev tools and seeing an error in the console that it tried to load a test.css
from your themes folder and failed.
Instead use plugins_url
.
e.g.
plugins_url( 'images/wordpress.png', __FILE__ )
Where the first parameter is the path to the file in your plugin folder, and the second parameter is the main plugin file location on the server.
So this:
get_template_directory_uri() . 'test.css'
becomes:
plugins_url( 'test.css', __FILE__ );
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]
- How can I enqueue a style only when a particular widget is active?
- Prevent CSS/JS loading when plugin is not used
- wp_enqueue_style specifics for overwriting plugin styles
- Load CSS before Theme CSS
- How can I use WordPress functions in my stylesheet?
- How do I force wp_enqueue_scripts to load at the END of ?
- Using standard backend elements in Plugin
- Using tabs for wordpress plugin
- Override CSS settings of plugins
- Best way to inject css into admin_head in plugins?
- Styles and Scripts, Selectively enqueue across entire site
- 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 enqueue a theme style-sheet to my admin settings page?
- W3 Total Cache: Load CSS asynchronously for better PageSpeed score? [closed]
- Is it possible to enqueue CSS files from plugin before theme’s CSS files?
- ‘Customize’ button in admin bar for CSS
- Why isn’t “background-image: url”working with Bootstrap carousel on WP?
- How to generate CSS from a shortcode within a plugin
- Add stylesheets and js to template files when shortcode is used
- How do I modify the position of a plugin?
- How to make wp_enqueue_style and wp_enqueue_script work only on custom post type
- Is there an earlier hook than login_head or login_enqueue_scripts?
- CSS from textarea in options page to frontend what to do
- custom changes removed after plugin update
- Can someone please tell me what is wrong with my plugin?
- WPBakery JS composer unused css [closed]
- How to tie dark mode with prefers-color-scheme webkit? [closed]
- Trouble with plugin styles in admin area of WordPress
- Removing included CSS file that doesn’t exist
- How to create an input field, and base the output on spreadsheet data? [closed]
- how to access all user dashboard on fronted page [closed]
- Bootstrap and Custom CSS in custom plugin are being overwritten by theme
- Ability to automatically redirect a URL
- Adding Font Awesome to WP Plugin
- Which filter affects the ‘entry-title’ post class
- Adding CSS to custom post type admin page causes error
- How to use my menu PHP code as sidebar?
- Redirect to another page using contact form 7? [closed]
- Edit External CSS
- Full list of registered scripts or styles, but from an admin options page
- Overwrite a plugin’s CSS?
- Combining several CSS files into one for optimization
- Making that Admin Bar transparent or a blue color
- How to execute a plugin on a single page only?
- How to limit image size for the entire website ? But without editing the post (css/plugin?!)
- Skewed / slanted button within elementor [closed]
- plugin dev – minimum base css specificity?
- get specific value of a array | PHP
- Override/ignore CSS from active theme as not to interfere with my custom CSS
- wp_enqueue_style on template_redirect level?
- Historical customisations won’t go away [closed]
- Custom plugin – load enqueue only for this plugin
- plugin enqueue style on all pages
- change or add css to theme from plugin
- At a Loss on over Page Peel Plugin Customization [closed]
- Custom CSS not being added by plugin
- Blocking Plugin Css to load custom in template directory
- Add background image/layout for single page?
- Theme deactived html and css styling on home page posts
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- How do I minify a plugins CSS/JS code?
- Edit all $wp_scripts at once to $in_footer = false
- Two plugins using the same CSS id
- How to remove Unused CSS From a WordPress Theme?
- Is there any known plugins that would replace WordPress classes in editor with their Bootstrap 4 equivalent?
- Applying module CSS to page
- Changing the CSS with a plugin
- how to change a static testimonials into dynamic
- How to change the width of certain paragraph or header blocks?
- Speeding up WordPress on a Local Network
- Edit the stylesheet of a child theme
- How do I override WordPress plugin css [closed]
- WP Plugin CSS not being applied to page
- Customize CSS for “Swipebox ” lightbox
- Best use adding user generated JS/CSS to a theme with a plugin
- Site not displaying correctly when re-directing from root to sub-directory
- WordPress audio player add class randomly using Audio Album plugin
- Best way for overwriting plugin css with custom one
- Child Theme Changes Are Not Reflecting In Parent Theme
- How to set up php,javascript and css to allow for our finished product to be displayed within a page?
- Display alt text as tool tip on page
- Overwrite CSS of Instaemail plugin popup
- contact 7 plugin stops some pages from working properly
- How to add different CSS for galleries
- MultiPostThumbnails and media queries
- Trouble After Update, Removing Plugin
- Plugins to generate CSS Sprites? [closed]
- Eliminate Render blocking CSS?
- Trying to disable all notifications except for one on woocommerce checkout page with css [closed]
- How to Add a Website Background Image to One Page?
- Woocommerce Product Page Collapsible Box Using CSS
- How to modify submit button on GravityForms
- Can I merge all my JS and CSS in one file using WP?
- Is there a membership plugin which offers the ability to hide content based on css rules?
- How to add an active state class to my info box