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
Michael Su
Member
Free Members
Offline
Jun 5, 2013 - 2:40 am

Hello,

I'm having trouble with CodeCanyon's Extensio theme.

 

Simplepress looks gorgeous on my site, http://www.sitrep.at , and we have the forum at sitrep.at/forum. Everything looks great, works well, but of course, the Add Topic button doesn't work. Following the FAQs, it looks like the theme is calling google for jquery, resulting in the script error. I've contacted the author of this popular looking theme, but have not been able to get a response. Would you mind taking a look at the functions.php code and letting me know if there's something I can do to fix the issue?

Following your advice to others, I enclose the original functions.php with the jquery calling to Google, and the sourcecode of the homepage. If there's anything else I can do, please let me know. 

Many thanks in advance,

Michael

---

 

Avatar
Michael Su
Member
Free Members
Offline
Jun 5, 2013 - 2:42 am

If it helps, I'm also getting the following error in the Simplepress log:

file: /simple-press/sp-api/sp-api-plugins.php
line: 82
function: Unavailable
Warning | closedir() expects parameter 1 to be resource, null given

 

 

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Jun 5, 2013 - 5:36 am

Look in the functions file and fnd the function:

function my_init_scripts() and right at thw top there are these three lines:

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');

Just comment out the top two leaving the wp_enqueue_script() line to be processed.

The theme is loading a 'tabs' library and 'accordion' library it has supplied. These should really be loaded from the libraries supplied by WP especially as they will get out of date with the main jQuery version. But he is also loading a 'tabs2' script and I have no idea what that is and how it might interact. So I would try the one change first to see what happens and see if anything else gets broken by it.

 

andy-signature.png
YELLOW
SWORDFISH
Avatar
Michael Su
Member
Free Members
Offline
Jun 5, 2013 - 10:53 am

Hello Yellow Swordfish, and thank you for the suggestion!

Commenting out the first two lines fixed the Add Topic issue in SimplePress, while leaving tab & tabs2 (for a side bar menu) working. However, consistently, it breaks the Nivo-slider that's on the homepage. I've updated the nivo-slider with the latest version, but still no go. I also edited the second line above to call from wp-content, which did fix the Add Topic, but broke the slider again.

Sorry to trouble you again, but would you have any idea for calling jquery just for the forum page, but not elsewhere?

 

Thank you very much in advance!!

 

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Jun 5, 2013 - 11:40 am

You could try using the

sp_is_forumpage()

function. Only perfoprm those changes if this is true...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
Offline
Jun 5, 2013 - 11:47 am

you can do a check...

if (sp_is_forumpage()) { # forum page stuff here } else { # non forum page }

Avatar
Michael Su
Member
Free Members
Offline
Jun 5, 2013 - 12:54 pm

Thank you both for your help. I added the conditional per above, the main site works, slider works (actually onebyone), but still can't get Add Topic to work. Would you mind checking my edits to this section? Very much appreciated your quick reply. Many thanks again!!

My forum page is just http://www.sitrep.at/forum/. The text below works for everything else except the Add Topic.

-----

 

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');

 

if (is_home() || is_front_page())

if (get_option($shortname.'_slider_type') == 'Piecemaker Slider') {

wp_enqueue_script('jquery_swfobject', get_template_directory_uri().'/js/piecemaker/swfobject.js', false, '2.1', false);

}

 

if ( (is_page_template('portfolio-two-sortable.php')) || (is_page_template('portfolio-three-sortable.php')) || (is_page_template('portfolio-four-sortable.php')) ) {

wp_enqueue_script('jquery_isotope', get_template_directory_uri().'/js/isotope/jquery.isotope.min.js', false, '1.5.04', false);

}

 

wp_enqueue_script('jquery_tabs', get_template_directory_uri().'/js/tabs.js', false, '1.0', false);

wp_enqueue_script('jquery_tabs2', get_template_directory_uri().'/js/tabs2.js', false, '1.0', false);

wp_enqueue_script('jquery_accordion', get_template_directory_uri().'/js/jquery.accordion.js', false, '1.0', false);

 

wp_enqueue_script('jquery_caroufredsel', get_template_directory_uri().'/js/jquery.carouFredSel-5.5.0.js', false, '5.5.0', false);

 

if (is_home() || is_front_page())

if (get_option($shortname.'_slider_type') == 'Accordion Slider') {

wp_enqueue_script('jquery_accordion_slider', get_template_directory_uri().'/js/accordion/accordion.js', false, '5.5.0', false);

}

 

//if (is_home() || is_front_page())

//if (get_option($shortname.'_slider_type') == 'OneByOne Slider') {

wp_enqueue_script('jquery_onebyone_slider', get_template_directory_uri().'/js/onebyone/jquery.onebyone.js', false, '1.0', false);

wp_enqueue_script('jquery_touchwipe', get_template_directory_uri().'/js/onebyone/jquery.touchwipe.min.js', false, '1.1.0', false);

//}

 

wp_enqueue_script('jquery_prettyphoto', get_template_directory_uri().'/js/jquery.prettyPhoto.js', false, '3.1.3', false);

wp_enqueue_script('jquery_main', get_template_directory_uri().'/js/main.js', false, '1.1.0', false);

 

wp_enqueue_script('jquery_validationengine_lang', get_template_directory_uri().'/js/contact/languages/jquery.validationEngine-en.js', false, '1.0', false);

wp_enqueue_script('jquery_validationengine', get_template_directory_uri().'/js/contact/jquery.validationEngine.js', false, '2.5.1', false);

 

} }

}

Avatar
Yellow Swordfish
Glinton, England
SP Master
Offline
Jun 5, 2013 - 2:49 pm

As far as I can see it should be OK. When you load a forum page, have you checked the source code being generated to see if jQuery is still being served up from google?

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

Thank you for replying.

Keeping with the above code edit:

On the forum page, nothing is being called from google (except fonts), only locally, but Add Topic is still not working.

 

On the other pages, all the sliders and tabs are working just fine.

I then tried a jquery plugin to update the wp jquery to the latest version thru WP jQuery Plus.

 

I'm so stuck! Thank you for keeping on top of this.

 

 

Avatar
Michael Su
Member
Free Members
Offline
Jun 5, 2013 - 3:06 pm

I also changed themes, which corrected the Add Topic issue. So it's only the theme I'm using, for which I can't get a response from the author....

 

 

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