Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1100231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:50:57+00:00 2026-05-17T00:50:57+00:00

How To Include CSS and jQuery in my WordPress plugin ?

  • 0

How To Include CSS and jQuery in my WordPress plugin ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:50:58+00:00Added an answer on May 17, 2026 at 12:50 am

    For styles wp_register_style( 'namespace', 'http://locationofcss.com/mycss.css' );

    Then use: wp_enqueue_style('namespace'); wherever you want the css to load.

    Scripts are as above but the quicker way for loading jquery is just to use enqueue loaded in an init for the page you want it to load on: wp_enqueue_script('jquery');

    Unless of course you want to use the google repository for jquery.

    You can also conditionally load the jquery library that your script is dependent on:

    wp_enqueue_script('namespaceformyscript', 'http://locationofscript.com/myscript.js', array('jquery'));

    Update Sept. 2017

    I wrote this answer a while ago. I should clarify that the best place to enqueue your scripts and styles is within the wp_enqueue_scripts hook. So for example:

    add_action('wp_enqueue_scripts', 'callback_for_setting_up_scripts');
    function callback_for_setting_up_scripts() {
        wp_register_style( 'namespace', 'http://locationofcss.com/mycss.css' );
        wp_enqueue_style( 'namespace' );
        wp_enqueue_script( 'namespaceformyscript', 'http://locationofscript.com/myscript.js', array( 'jquery' ) );
    }
    

    The wp_enqueue_scripts action will set things up for the “frontend”. You can use the admin_enqueue_scripts action for the backend (anywhere within wp-admin) and the login_enqueue_scripts action for the login page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to include a css file to a jquery plugin. I can choose
I am using a pre-existing jQuery popup plugin for a WordPress site. The popup
I have a mobile app created using HTML/JS(jQuery)/CSS and I'm looking to include page
My WordPress site is having some major IE issues that include jQuery, box-shadow, and
We include the CSS file via standard HTML STYLE tag. Then we need the
I have wrote a little function to dynamically include CSS file or JS file.
I'm trying to include the jquery helper in my zend project, documentation from zend
I want to use the hover feature of cluetip jquery plugin . I am
I am in a situation where I have two WordPress plugins that include the
I included a Graphing and Plotting Jquery library called JQplot with wordpress using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.