WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Jquery help? Multiple versions? (19 posts)

  1. JCKnoell
    Member
    Posted 3 months ago #

    I am looking through my header file and I noticed multiple instances of calling jquery. Some are different versions, some are "custom" (whatever that means)

    <script src="/wp-content/themes/cleantelligent/js/jquery.cycle.all.js" type="text/javascript"></script>
    <script src="/wp-content/themes/cleantelligent/js/jquery-ui-1.8.19.custom.min.js" type="text/javascript"></script>
    
    <script type='text/javascript' src='/wp-includes/js/jquery/jquery.js?ver=1.7.2'></script>
    <script type='text/javascript' src='/wp-includes/js/comment-reply.js?ver=3.4.2'></script>
    
    <script src="/wp-content/themes/cleantelligent/js/jquery.cycle.all.js" type="text/javascript"></script>
    <script src="/wp-content/themes/cleantelligent/js/jquery-ui-1.8.19.custom.min.js" type="text/javascript"></script>

    I'm guessing this is a problem, right?

    I'm a super newbie with jquery and I have no idea what I'm doing here. I'm guessing some of these scripts may have been placed here as part of a plugin for wordpress, or for something else entirely.

    Do I need multiple scripts for this? If I remove all but one, will it break some of my plugins? If anyone can explain to me how this works, I will be forever indebted to you. I am having a hard time understanding jquery.com.

  2. esmi
    Forum Moderator
    Posted 3 months ago #

    Most of those jQuuery calls are being added by your theme. Where did you download it from?

  3. JCKnoell
    Member
    Posted 3 months ago #

    Haha, that's a good question...

    I was called in to basically clean up this site because the guy before me did all sorts of stuff like this. I have no idea where any of it came from or what any of it is for...

    Yeah, I realize this is a job nobody would envy...

  4. esmi
    Forum Moderator
    Posted 3 months ago #

    What does it say in the theme's details or style.css file?

  5. JCKnoell
    Member
    Posted 3 months ago #

    Just that it was created by Sebo Marketing and that it's a child theme.

    Remember me? https://wordpress.org/support/topic/sidebar-on-singlephp-1?replies=33
    Yeah....

    But at least I did eventually figure out the sidebar issue.

  6. esmi
    Forum Moderator
    Posted 3 months ago #

    What is theme actually called? I can't find any reference to it

  7. JCKnoell
    Member
    Posted 3 months ago #

    It's called CleanTelligent. It's a Child theme of the twenty eleven parent theme. but it's pretty much a completely custom theme...

  8. esmi
    Forum Moderator
    Posted 3 months ago #

    That would explain why I can't find it in a theme shop. As it's effectively a bespoke theme, you may need to go back to the theme's developers about this. It looks like there's a bug in the theme - probably within its functions.php file.

  9. JCKnoell
    Member
    Posted 3 months ago #

    Hmm... can you point me in the right direction for the bug? Where is the bug and how did you find it?

  10. esmi
    Forum Moderator
    Posted 3 months ago #

    All I can suggest is that you try looking for wp_enqueue_script() in the theme's functions.php file.

  11. JCKnoell
    Member
    Posted 3 months ago #

    So, I know you can't really take the time to hold my hand through this, but I can't find that function reference, wp_enqueue_script(), in any themes... Not even in the WP default themes... Am I supposed to find this somewhere?

  12. esmi
    Forum Moderator
    Posted 3 months ago #

    The default 2014 theme does not use wp_enqueue_script() because it does not load any jQuery scripts, Your custom theme does and appears to be doing so incorrectly. Have you tried looking for scripts in header.php?

  13. JCKnoell
    Member
    Posted 3 months ago #

    all the scripts listed above are in my header.php file... Do I need a specific one?
    Where would I put the wp_enqueue_script()?
    :S

  14. JCKnoell
    Member
    Posted 3 months ago #

    I've been reading up on this and it's super confusing, but I think I'm understanding it. My only question is, if I have the <script></script> tags in my header.php, do I need wp_enqueue_script()?

    I guess it enables me to call different scripts on different pages so they don't conflict... is that right?

  15. esmi
    Forum Moderator
    Posted 3 months ago #

    You shouldn't have any script calls in the head section of your theme. Your theme has been badly designed. You need to go back to whoever developed it for you.

  16. JCKnoell
    Member
    Posted 3 months ago #

    Okay. This makes sense... Man, I hate that company.

    Just to clarify though, I need to go back to them for what? to have them re-write it? Or to ask why they wrote it that way? Can't I just fix it and move on?
    ( we don't want to have to pay them to fix their originally crappy theme, ya know)

    Anyway, thanks for your help. I'm sure we'll figure this out eventually.

  17. esmi
    Forum Moderator
    Posted 3 months ago #

    to have them re-write it? Or to ask why they wrote it that way?

    Either or, really.

    Can't I just fix it and move on?

    As I do not know this custom theme, I cannot guarantee that this will work.

  18. JCKnoell
    Member
    Posted 3 months ago #

    Okay. Well thank you sincerely for your help. I always appreciate your comments, esmi. You really seem to know your stuff.

  19. esmi
    Forum Moderator
    Posted 3 months ago #

    I try. :-)

    I think you need to ask the developers of this theme why they added scripts into the theme's header.php template file instead of using wp_enqueue_script( which is the Right Way(tm) do do this). They may have had a reason and anything I suggest now could stop the theme from working effectively.

Reply

You must log in to post.

About this Topic