How to link css and JavaScript in wordpress?

//How to link css and JavaScript in wordpress?
How to link css and JavaScript in wordpress? 2018-09-17T22:28:39+05:30

Website Design Company In Mumbai Mobile App Services Conveys Forums WordPress Development How to link css and JavaScript in wordpress?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • conveys
    Keymaster
    Post count: 6

    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');

    How to add images in wordpress plugin?

    For images you can use plugins_url ( 'img/image.png', __FILE__ );

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Rate us
Rated 5.00 out of 5.0 for Conveys Support service by 14 clients on over 15000+ projects.