Access our premium support and let us know your problems, we will help you solve them.

0
No products in the cart.

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: How To Include CSS and jQuery in my WordPress plugin? #10007
    blankcalimero
    Participant

    Put it in the init() function for your plugin.

    function your_namespace() {
        wp_register_style('your_namespace', plugins_url('style.css',__FILE__ ));
        wp_enqueue_style('your_namespace');
        wp_register_script( 'your_namespace', plugins_url('your_script.js',__FILE__ ));
        wp_enqueue_script('your_namespace');
    }
    
    add_action( 'admin_init','your_namespace');
    

    It took me also some time before I found the (for me) best solution which is foolproof imho.

    Cheers

Viewing 1 post (of 1 total)