Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
help w jquery problem with my theme
Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Jun 5, 2013 - 3:10 pm

I just loaded a forum page and it look to me like the main jQuery library is still being called from google (ajax.googleapis.com).

That may not be the only problem by the way but still has to be sorted first. SO... is this WITH the code change we made earlier?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Michael Su
Member
Free Members
Offline
Jun 5, 2013 - 3:12 pm

yes, still as below:

----

function my_init_scripts() {

if (sp_is_forumpage()) {

wp_enqueue_script('jquery'); } else {

if (!is_admin()) {

global $shortname;

wp_deregister_script('jquery');

wp_register_script('jquery','http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', false, '1.7.1');

wp_enqueue_script('jquery');

 

/* etc.... */

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Jun 5, 2013 - 3:27 pm

Ah - I meant ask this earlier. The file you attached was called '99functions.php'. Is this what it is actually named? As WordPress will explicitly be looking for a file called 'functions.php' in the main theme folder.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Michael Su
Member
Free Members
Offline
Jun 5, 2013 - 3:30 pm

sorry for the confusion, I did change it to functions.php. I've been using the numbers to keep track of the changes, but the version I'm uploading has the right name.

 

if it helps, I reattach the file to this reply. thank you again for trying to help!!! much, much obliged!!

 

michael

 

--

 

Avatar
Michael Su
Member
Free Members
Offline
Jun 6, 2013 - 12:46 am

after trying all day, finally got it to work, and without the conditional. amazing how hard that was!!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Jun 6, 2013 - 1:18 am

good to hear!  thanks for the update...

Avatar
Michael Su
Member
Free Members
Offline
Jun 6, 2013 - 1:48 am

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,

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Jun 6, 2013 - 6:02 am

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...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Michael Su
Member
Free Members
Offline
Jun 26, 2013 - 6:30 am

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.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Jun 26, 2013 - 10:07 am

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...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625