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? #10001

    Very Simple:

    Adding JS/CSS in the Front End:

    function enqueue_related_pages_scripts_and_styles(){
            wp_enqueue_style('related-styles', plugins_url('/css/bootstrap.min.css', __FILE__));
            wp_enqueue_script('releated-script', plugins_url( '/js/custom.js' , __FILE__ ), array('jquery','jquery-ui-droppable','jquery-ui-draggable', 'jquery-ui-sortable'));
        }
    add_action('wp_enqueue_scripts','enqueue_related_pages_scripts_and_styles');
    

    Adding JS/CSS in WP Admin Area:

    function enqueue_related_pages_scripts_and_styles(){
            wp_enqueue_style('related-pages-admin-styles',  get_stylesheet_directory_uri() . '/admin-related-pages-styles.css');
            wp_enqueue_script('releated-pages-admin-script', plugins_url( '/js/custom.js' , __FILE__ ), array('jquery','jquery-ui-droppable','jquery-ui-draggable', 'jquery-ui-sortable'));
        }
    add_action('admin_enqueue_scripts','enqueue_related_pages_scripts_and_styles');
    
Viewing 1 post (of 1 total)