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
- Problem with inline style CSS properties issue on DIV
- How to give a NavWalker its own stylesheet?
- wp-cron and execution of code in is_admin() included script
- update your existing plugin’s WordPress compatibility
- Change WooCommerce Email Header using custom plugin
- use of do_action() without any functions attached
- How dynamic action login_form_{action} is working
- How to modify files inside wp-includes directory in wordpress
- How to Move the Comments Bubble to the Right Side of the Toolbar
- WP Multisite login not working on one subsite. Possibly cookies/ history issue?
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- dbDelta not installing database
- Fatal error: Call to a member function get_page_permastruct() on a non-object
- What happens when two or more plugins use the same hook?
- How to handle shortcodes through plugin
- wp_get_post_terms Order by not working
- How do I add a favicon that only shows during viewing of my plugin’s admin panel?
- Can’t get CSS Into the Head via add_action
- Plugin is not generating title tags on any pages or posts
- pagination in a custom list created with get_pages function
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- Does admin_print_scripts-$hook_suffix work for nested paths to individual files?
- Adding fields to category manager. Does a method exist to get the link to the category edit screen?
- Correct syntax for database inserts from plugin?
- How to add a widget to the post editing view?
- How can I identify it as admin page or not?
- How to test a WordPress plugin in real time