Support Forum

help w jquery problem with my theme

25 Answers

New Answer

MS Michael Su
Michael Su
Member

actually, never mind. still couldn’t resolve it. I thought I did, cleared the cache, restarted the browser, and same problem.

 

I’ve contact the theme author (extensio on codecanyon), the plugin author (onebyone on codecanyon), and still can’t figure out how to avoid the jquery conflict on the forum page.

 

Any other ideas?

 

Thank you again,

YS Yellow Swordfish
Yellow Swordfish
Member

It’s hard to know why that SP page check function is not returning a true as it should. It does check out OK when I try it on test sites and we have other users who have utilised the same function call for this very reason.

You could try one thing although I see no reason why it should help. But it would bring it into line with my own test environments so perhaps worth a try.

You theme there is running the scripts init code with this hook:

add_action('wp_print_scripts', 'my_init_scripts');

You could try changing that to:

add_action('wp_enqueue_scripts', 'my_init_scripts');

just in case…

MS Michael Su
Michael Su
Member

Hello,

Thank you for your help a few weeks ago. With your help, I was able to correct the problem and it’s been working fine for 3 weeks. Just today, I checked my site, and found that the forum javascript buttons stopped working. Clicking on the Add Topic, Reply, etc. produces the dreaded void issue. The strange thing is I don’t think I’ve changed anything…

I previously corrected the issue with loading multiple jquery libraries by only loading the onebyone slider specific jquery call to google on the front page, and that’s fine. Now, when inspecting the source code on my forum page, I don’t see the call to google. So I’m really at a loss as to what could be causing this new problem. Please help!! The site is http://sitrep.at/forum/ . What I’ve done since first correcting the problem is install Wordfence Security and Events Manager, but they did not seem to affect the forum.

 

Oh, of course, the forum works properly when I revert to the Twenty Twelve theme, so I’ve been focusing on conflicts with my theme.

 

Thank you in advance.

MP Mr Papa
Mr Papa
Member

your site is throwing four or five errors on page loads… they are jquery/js errors…  there is nothing obvious that I can causing them, except for perhaps the use of $ vice jQuery…  but that is often okay too..  but each one that is failing is loading js script inline on the page and using $ for the namespace…

first, trying going to forum – toolbox -housekeeping and try resetting the combined js cache…  dont think it will help, but worth a try…

MS Michael Su
Michael Su
Member

Thank you for checking on my site. I had not realized it was throwing so many errors. At least I know that jquery was working at some point before, after many days of trial and error. I did run the housekeeping, resetting the cache, to no avail.

 

I also tried what Yellowfish suggested above, but that only broke the theme appearance.

 

It’s very confusing that it was working fine, and now not so much! Our forum is basically inoperable for the moment. Would it help if I included my function.php? I know it’s a lot to look through, but I commented in/out what I added, under my initials mwss. Perhaps you would not mind taking a quick look?

 

 

MP Mr Papa
Mr Papa
Member

is that the way the theme comes??? or did you change to all those enqueue statements?  using wp_enqueue_scripts is proper, but oddly there are no dependencies specified…

so if it was working, what has changed??  update theme or plugins?

MS Michael Su
Michael Su
Member

hello again, wow that was fast! yes, the theme comes like that, all I did was comment to make it load from google just for the plugin onebyone, otherwise just enqueue. I checked the errors, now I’m getting:

questions:115 TypeError: ‘undefined’ is not a function (evaluating ‘$’)
questions:119 TypeError: ‘undefined’ is not a function (evaluating ‘$(document)’)
questions:137 TypeError: ‘undefined’ is not a function (evaluating ‘$(document)’)
questions:529 TypeError: ‘undefined’ is not a function (evaluating ‘$(‘a[data-rel]’)’)
jquery.ui.widget.min.js:5TypeError: ‘undefined’ is not a function (evaluating ‘e.widget.extend({},this.options,this._getCreateOptions(),t)’)

 

I didn’t change all those enqueue statements. how odd? I contacted the author, who would not reply to me, though he just pushed out an update that specific did not address this issue. so frustrating!!

MS Michael Su
Michael Su
Member

do you mean all the enqueue within the set starting with if (!is_admin …?

 

yup, that’s all from the theme, all the enqueue_scripts for tabs, tabs2, etc.

 

generally, should there by anything before wp_enqueue_script like a wp_register_script? From if (!is_admin it goes directly to wp_enqueue_script(‘jquery’); .

 

thank you again for your quick response. much, much obliged!

 

MS Michael Su
Michael Su
Member

also, same theme version, same plugin version. differences are that I installed Events Manager, Fullcalendar, and Wordfence.

MP Mr Papa
Mr Papa
Member

what happens if you temp disable those?  just to narrow it down…

notice the errors you lsted?  all start with $… known to sometimes conflict in wp jquery… you could try finding those where included in the header and change the $ to jQuery and see if any impact…