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

  • Home
  • SEARCH
  • 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 8401819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:54:12+00:00 2026-06-09T21:54:12+00:00

Hi I am jsut recently learning to develop wordpress themes and at first I

  • 0

Hi I am jsut recently learning to develop wordpress themes and at first I added the jquery script and other scripts like this:

<script src="<?php bloginfo('template_directory') ?>//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>

But today while doing some tutorials I found that this is not the best way of doing things , so I started searching on the internet and I found how to do it:

  function register_js(){
    wp_deregister_script('jquery');
    wp_register_script('jquery' , '//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js');
   }
add_action('init' , 'register_js');

But for some reasons all the scripts I have on my page say that jQuery is not defined or $ is not defined.What am I doing wrong?

  • 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-06-09T21:54:13+00:00Added an answer on June 9, 2026 at 9:54 pm

    You are missing the wp_enqueue_script function.

    Detailed here: http://codex.wordpress.org/Function_Reference/wp_enqueue_scrip

    WordPress Example:

    <?php
    function my_scripts_method() {
        wp_deregister_script( 'jquery' );
        wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
        wp_enqueue_script( 'jquery' );
    }    
    
    add_action('wp_enqueue_scripts', 'my_scripts_method');
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a report that shows client names jsut in a list like so:
I want to develop C on Windows, but I really like just using vim
I jsut checked the sample of jQuery UI that opens a dialog, it's strange
I haven't seen this anywhere (or maybe I'm jsut simple not seeing it) but
Just learning about Dependency Injection and Prism... It seems just asking around alot of
I have a file upload script that works [finally] but want to have users
i know this should be simpel and im probably staring straight at the problem
First off, a lil about me, i'm very new to GUI programming, especially with
I have this problem. I need to have a method repeated endlessly, if possible,
I have 2 multi selectors in extJS (respondents groups and jsut respondents). Erery respondent

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.