First you need to register the style and css using wp_register_script() and wp_register_style() functions
//registering css
wp_register_style ( 'mysample', plugins_url ( 'css/MapStyle.css', __FILE__ ) );
wp_register_script ( 'mysample', plugins_url ( 'js/MapStyle.js', __FILE__ ) );
After this you can call the wp_enqueue_style() functions for loading the css in required page
wp_enqueue_style('mysample');
wp_enqueue_script('mysample');
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?
- Which hook should be used to add an action containing a redirect?
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- Making a plugin file accessible via url rewrite?
- Custom admin_notices Messages Ignored During Redirects
- 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
- Pages 404 in wordpress
- What is better way to use Bootstrap inside admin panel?
- wp_enqueue_style built in styles
- Backslashes being stripped from CSS
- How to redirect to action on custom page within admin section
- 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?
- Redirect user to a particular link in 10 seconds after using wp_die
- Remove Internal Style Sheet if no Value Provided?
- How do I include background images in my stylesheets in a plugin?
- Change template dynamically
- What parameter should I pass to wp_enqueue_style to depend on the themes stylesheet?
- Is there no admin ui guide for 4.x?
- Correct check for any admin page with editor
- On cliking add new post redirect user to a custom page first
- Show custom data instead of 404
- Force HTTPS 301 redirect with hook
- How to remove default style of header in wordpress metabox
- Add a new confirmation page before saving
- 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
- How to redirect to login page when user not loggedin on a particular page
- Styles don’t load correctly. Insecure content
- Completely isolate a plugin view so it doesn’t load the theme
- Does WordPress default CSS have Grids?
- 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
- Is there any way to pass messages from a script to a redirect target in a hidden fashion?
- How to add some basic inline CSS using existing plugin or theme?
- Custom payment method after payment user is logged out on thank you page
- 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?
- How to Login a User inside a Plugin and Redirect to page?
- Twenty-seventy theme remove additional CSS from head
- Add New Button in Admin Panel
- Redirection from a specific page for users logged in but not with membership
- Redirect WooCommerce checkout to cart
- Creating a return url for getting data from external api
- redirect_to how to make it simply work with get parameter or similar?
- 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
- How can I add the Post ID to Class Name in Jquery?
- Any way to make Apache’s internal redirect work?
- Let user override plugin CSS
- How to load another page file of my custom plugin file
- Redirections the right way inside a plugin directory
- Best practice to include custom user styles in widgets
- How to create A – Z List with pictures?
- Custom rewrite, url path with parameters to a page
- how to add contact form 7 shortcode in javascript variable
- Looking for WordPress System Diagrams
- How to output message during plugin activation
- How to provide translations for a WordPress TinyMCE plugin?
- Check the Version of an Enqueue’d External Library
- Change of query var in pre_get_posts not maintained
- How to Parse an Array of Elements in Gutenberg Block
- Custom rewrite rule serves content, but returns 404 error code
- Will changing the ‘Plugin Name’ header in the next update of a plugin break anything?
- Performance of several get_option() calls
- How to edit mySQL wp_posts table from plugin php?
- Creating a Wordpess Plugin that writes data to a csv file. The data doesn’t show in the csv file?
- Problem with is_active_sidebar?
- “Plugin could not be activated because it triggered a fatal error.”
- Add column in WP user but it goes wrong
- How to remove the current post from the query?
- Is file_get_contents() the only way for plugins reading local files OR does WP_Filesystem_Direct::get_contents() even work?
- hook filter after the_content on a specific page
- Run command “composer install” when activating wordpress plugin
- JQuery Slider – Similar to www.internetmarketinginc.com [closed]
- Development plugin to view and manage scheduled wordpress cron jobs?
- Add user managable titles to custom menus?
- Custom Icon for Plugin
- WordPress OOP get current user question?
- Override WooCommerce files from plugin
- How to get an array out of a nav menu if it’s a plugin?
- How to develop custom URL redirection
- Reinitiate Gutenburg’s blocks using javascript