This topic has 6 replies, 2 voices, and was last updated 8 years by Radu.

  • Author
  • #103065
     k3m
    Participant

    Hi,

    I’m trying to replace theme app.js with the customised version of it, copied to the child theme but when I do it I receive an error in chrome console that some of the elements are incorrect.

    File is almost identical, the only change is done within accordionInfo().

     

    Could you please advise what could be a problem and how to fix it?

    Code used to load custom js script:

    add_action(‘wp_enqueue_scripts’, ‘load_custom_js’);

    function load_custom_js()

    {

    wp_dequeue_script(‘app’);

    wp_enqueue_script(‘app’, get_stylesheet_directory_uri().’/assets/scripts/app.js’, array(‘jquery’));

    }

    Thank you

    Attachments:
    You must be logged in to view attached files.
    #103199
     Radu
    Moderator

    Hi,

    If you will look in source code instead of parent theme is loaded only child-theme/app.js ?or both ?

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #103278
     k3m
    Participant

    only child theme app.js is loaded but as I mentioned before they are basically the same with only difference in one function

    #103356
     Radu
    Moderator

    an if you will load identical file like in parent app.js from child theme that error persists ? or disappear ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #104681
     k3m
    Participant

    issue persists in both cases

    #104761
     Radu
    Moderator

    Hi,

    I understand, to be clear, with parent theme activated the issue is the same ?

    If yes, disable all plugins clear your browser cache and server cache if you have and check again console and let me know.

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #104762
     Radu
    Moderator

    If the error disappear enable plugins one by one to identify what causes this.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?