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
    Participant
    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.