• Harry

    (@testingleis)


    Hi

    I am using WordPress 5.0.3. I am facing an issue.

    I have added a jquery in footer, Its working fine when I am logged in, But Its not working for logout users.

    I tried to add the script in header file, and enque the script in functions file and also tried with custom JS plugin. But nothing works.

    Please help me.
    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Prem Tiwari

    (@freewebmentor)

    Hi @testingleis

    Your enqueue function will look like this:

    wp_enqueue_script( 'script', get_template_directory_uri() . '/js/script.js', array ( 'jquery' ), 1.1, true);

    Thread Starter Harry

    (@testingleis)

    Thanks for reply

    I have used the same format.

    When I check for script in inspect element, Its showing where I am logged in, and not showing for logout users.

    Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Does it work if you use a bundled theme like Twenty Nineteen or Twenty Seventeen?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘JQuery not loading for logout users’ is closed to new replies.