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 8478359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:43:26+00:00 2026-06-10T18:43:26+00:00

May there is very simple solution but I am facing issue to solve this

  • 0

May there is very simple solution but I am facing issue to solve this as new to these all.

I am enqueue jquery and other script from my theme function php file. Below is my code

function mediaplus_scripts() {
        if (!is_admin()) {
            wp_deregister_script( 'jquery' );
            wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js');
            wp_enqueue_script( 'jquery' );
        }

        wp_enqueue_script( 'theme-js', get_template_directory_uri() . '/js/theme.js', 'jquery' );

        wp_enqueue_script( 'listgrid-cookie', get_template_directory_uri() . '/js/list-grid/cookie.js', 'jquery' );

        wp_enqueue_script( 'listgrid', get_template_directory_uri() . '/js/list-grid/listgrid.js', 'jquery' );

        wp_enqueue_script( 'slider-easing', get_template_directory_uri() . '/js/jquery.easing.1.3.js', 'jquery' );

        wp_enqueue_script( 'home-slider', get_template_directory_uri() . '/js/slides.min.jquery.js', 'jquery' );

        wp_enqueue_script( 'home-ajax-content', get_template_directory_uri() . '/js/dynamic-page/dynamicpage.js', 'jquery' );

        /* wp_enqueue_script( 'mediaplus-script', get_template_directory_uri() . '/js/functions.js', 'jquery' ); */ 

    } 
    add_action('init', 'mediaplus_scripts');

    function add_admin_scripts() {

        wp_deregister_script( 'jquery' );
        wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js');
        wp_enqueue_script( 'jquery' );

        wp_enqueue_script( 'mediaplus_options', 'http://cdn.jquerytools.org/1.2.6/jquery.tools.min.js', 'jquery' );

    }
    add_action('init', 'add_admin_scripts');

Problem with the code is admin enqueue function is conflicting with theme function and resulting disabling all javascript in theme only admin jquery is working.

Is there any way to solve this?

  • 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-10T18:43:28+00:00Added an answer on June 10, 2026 at 6:43 pm

    The solution of your problem is in the add_action.

    add_action(‘wp_enqueue_scripts‘, ‘mediaplus_scripts’);

    instead of

    add_action(‘init’, ‘mediaplus_scripts’);

    The wp_enqueue_scripts is used for the front-end and admin_enqueue_scripts for the admin. The init action is called for both.

    I had the same problem and thanks to john for the link 😉

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

Sidebar

Related Questions

Pretty new to Perl so there may be a very obvious solution here. I'm
This may not be possible for the carousel but is there a way to
This seems like a very simple problem, but I cannot get a scrollbox to
This seems to me like a very simple question, but I can't seem to
I may get some heat for this question because there are a lot out
There is very simple task I want to do, that somehow makes the program
In LINQ to SQL there is a very simple convention to tell the mapper
I've got a very simple question about a game I created (this is not
I have the following String Sample however in some occurences there may be one
I need to throw 404 error in module. Or may be there are any

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.