Support Forum

Images in posts not enlarging

66 Answers

New Answer

MP Mr Papa
Mr Papa
Member

change them to

wp_enqueue_script(‘jquery-ui’);

MA max99
max99
Member

but the line wp_enqueue_script is already there?

 

should I change this:

wp_enqueue_script(‘jqueryUI’, $protocol . ‘//ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js’);
wp_enqueue_script(‘jqueryUIWidget’, HYBRIDCONNECT_JS_PATH . ‘/jquery.ui.widget.js’);
wp_enqueue_script(‘jqueryUICheckbox’, HYBRIDCONNECT_JS_PATH . ‘/jquery.ui.checkbox.js’);

to: 

wp_enqueue_script(‘jquery-ui’);
wp_enqueue_script(‘jqueryUIWidget’, HYBRIDCONNECT_JS_PATH . ‘/jquery.ui.widget.js’);
wp_enqueue_script(‘jqueryUICheckbox’, HYBRIDCONNECT_JS_PATH . ‘/jquery.ui.checkbox.js’);

 

AND

this:

else {
wp_deregister_script(‘jquery’);
wp_register_script(‘jquery’, $protocol . ‘//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js’);
wp_enqueue_script(‘jquery’);
}

 

to:

else {
wp_deregister_script(‘jquery’);
wp_enqueue_script(‘jquery’);
wp_enqueue_script(‘jquery’);
}

 

 

MP Mr Papa
Mr Papa
Member

No. not quite..  a bit more complex based on that…

change

wp_enqueue_script(‘jqueryUI’, $protocol . ‘//ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js’);
wp_enqueue_script(‘jqueryUIWidget’, HYBRIDCONNECT_JS_PATH . ‘/jquery.ui.widget.js’);

to

wp_enqueue_script(‘jquery-ui’);
wp_enqueue_script(‘jquery-ui-widget’);

the other one, not sure there is enough info (might nee to see if statement)… but change

wp_deregister_script(‘jquery’);
wp_register_script(‘jquery’, $protocol . ‘//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js’);
wp_enqueue_script(‘jquery’);

to just

wp_enqueue_script(‘jquery’);

now this changes it everywhere…  this could affect your site elsewhere… you may need to only change if on forum page…  ie

if (sp_is_forumpage() {
   # do the change to stuff
} else {
   # do the original stuff
}

that way the changes are only taking place on the forum page…  using the wp jquery and jquery ui should obviously work everywhere, but cannot tell what the author may have done, modified or used…

 

MA max99
max99
Member

Thanks for adding more clarity. I made both changes (w/out the if stmt for now), and as expected that resulted in only one jquery being called (still version 1.8.2) from my site directly. But, it did not change anything re: the images on forum posts, I still get “javascript:null” with nothing happening when I click on an image.

Also, not sure if helpful, but during post preview, I could actually enlarge the image, just not in the final post.

 

Below is the entire code for the 2nd piece including if statement

 

function frontend_register_scripts() {

$protocol = ‘http:’;

if (!empty($_SERVER[‘HTTPS’])) {

$protocol = ‘https:’;

}

wp_register_style(‘hybridconnectreset’, HYBRIDCONNECT_CSS_PATH_TEMPLATES . ‘/problem-with-post-edit-buttonc_reset.css’);

wp_enqueue_style(‘hybridconnectreset’);

// handle problem themes. Some themes extend jQuery so loading a new version of jquery breaks the site.

if(wp_get_theme() == “Netix – Premium WordPress Landing Page” ||

is_plugin_active(‘slidedeck2-personal/slidedeck2.php’) ||

is_plugin_active(‘slidedeck2/slidedeck2-lite.php’) ||

is_plugin_active(‘slidedeck2-professional/slidedeck2-tier20.php’) ||

is_plugin_active(‘slidedeck2-developer/slidedeck2-tier30.php’)) {

wp_enqueue_script(‘jquery’);

}

else {

wp_deregister_script(‘jquery’);

wp_register_script(‘jquery’, $protocol . ‘//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js’);

wp_enqueue_script(‘jquery’);

}

}

MP Mr Papa
Mr Papa
Member

that’s not what I am seeing… I still see:

<script type=’text/javascript’ src=’http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?ver=3.5.1′></script>

on the forum pages…

looking a bit further it seems you are caching the forum pages.. you cannot do that since its dynamic in nature… so for w3tc, you need to disable it on the wp page the forum is on for ALL types of caching you are using…

and you need to make sure you CDN is not serving up a cached page either since every page is dynamic…  all forum content is displayed on that single wp page…

MA max99
max99
Member

Yes, I changed it back b/c (a) you said you needed to see the entire code incl. if statmenet (see above) and (b) it didn’t fix the issue. None of my attachments can be opened.

 

Removed W3 chache but didn’t help. Plus, I’ve excluded any forum pages from being cached anyway. Either way, with and w/out w3tc didn’t let me open attachments.

YS Yellow Swordfish
Yellow Swordfish
Member

So taking a quick look at your forum page….

Your WP Theme is now no longer loading any jQuery library at all. This is not really good as everything starts with the WP theme and if that needs jQuery it should load it. This is causing a ‘jQuery not defined’ error.

There is still a version being loaded from the Google CDN by a plugin which is NOT good.

Your WP theme actually has other issues I believe as well. It addresses jQuery using the ‘$’ shortcut but not in a way that is supported by WordPress.This is causing a ‘$ not defined’ error.

These are all issues, by the way, that the WordPress development team are trying to stamp out and they have even talked about having the WP core refuse to function with these badly constructed themes.

Additionally can I ask how you are embedding the links to these documents or images. All I see are links to doc.google.com but those links are malformed so how are you entering them please?

MA max99
max99
Member

I’m not sure I follow. I thought you had told me to remove the jquery call from my WP Theme? And re: the google CDN call, as I said, I deactivated the entire plugin (plus w3tc) and still no change to the image issue.

 

Re: the links. One was simply a URL link to an image hosted somewhere else. It did enlarge correctly during preview. The other two links are files attached by a forum user.

 

Can I just give you my wp-login via PM? I really just want to be able to use the forum. It’s been 3 days now and such a basic feature is not working. I know you’re saying it’s my theme, I just don’t know what else to do here.

 

Thanks!

MP Mr Papa
Mr Papa
Member

No, we never said get rid of jquery… we said get rid of the externally loaded version and use the one that comes with wp, like the wp standards call for…

as I view your site right now, its loading jquery from googlapis and still getting a cached page…

today is a tough day for us time wise… 

but we really need to see the site without our page being cached and the jquery from external sites removed in favor of loading the wp version (wp_enqueue_script())…

MA max99
max99
Member

Hmm, I thought I was supposed to remove the outdated 1.5.2 version.

On the page caching, I actually did disable it, I have the exact same settings as this guy:

http://www.byobwebsite.com/forum/plugins/simple-press-forum-cache-or-not/

Page caching disabled for all forum pages. Some static files are served via cdn, but nothing’s cached.

 

I’m really not sure what to do anymore from here on. Can you tell me the correct code I should place now that I’ve copy/pasted the full code including the if statement?

 

MP Mr Papa
Mr Papa
Member

copy and pasted full?  where?

did you make the changes I suggested a few posts back in #18

MA max99
max99
Member

Yes I did, I even removed the plugin completely. That didnt fix the image enlarging issue

 

Here’s the complete code for jquery in the plugin:

 

// jQuery UI – need to load jquery UI via CDN so deregister all wordpress jquery ui scripts that may conflict

wp_enqueue_script(‘jqueryUI’, $protocol . ‘//ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js’);

wp_enqueue_script(‘jqueryUIWidget’, HYBRIDCONNECT_JS_PATH . ‘/jquery.ui.widget.js’);

wp_enqueue_script(‘jqueryUICheckbox’, HYBRIDCONNECT_JS_PATH . ‘/jquery.ui.checkbox.js’);

 

 

AND:

function frontend_register_scripts() {

$protocol = ‘http:’;

if (!empty($_SERVER[‘HTTPS’])) {

$protocol = ‘https:’;

}

wp_register_style(‘hybridconnectreset’, HYBRIDCONNECT_CSS_PATH_TEMPLATES . ‘/problem-with-post-edit-buttonc_reset.css’);

wp_enqueue_style(‘hybridconnectreset’);

// handle problem themes. Some themes extend jQuery so loading a new version of jquery breaks the site.

if(wp_get_theme() == “Netix – Premium WordPress Landing Page” ||

is_plugin_active(‘slidedeck2-personal/slidedeck2.php’) ||

is_plugin_active(‘slidedeck2/slidedeck2-lite.php’) ||

is_plugin_active(‘slidedeck2-professional/slidedeck2-tier20.php’) ||

is_plugin_active(‘slidedeck2-developer/slidedeck2-tier30.php’)) {

wp_enqueue_script(‘jquery’);

}

else {

wp_deregister_script(‘jquery’);

wp_register_script(‘jquery’, $protocol . ‘//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js’);

wp_enqueue_script(‘jquery’);

}

}

MP Mr Papa
Mr Papa
Member

plugin?  for some reason thought this was in the theme…  but too many topics going on… ;)

what is this plugin used for?  does it actually do anything on the forum page?  if not, you could just use the plugin organizer (a wp plugin) and disable it on the forum page…

okay, based on the code you pasted, that sure looks like a theme… at the risk of angering you, can I ask you to confirm that its a plugin??

MA max99
max99
Member

No risk of angering me at all, I appreciate you looking into it closely :)

It is a plugin, Hybrid-Connect (slide-in opt in form). It is actually currently disabled. And I’ll be sure to use the plugin you suggested to not have it run on the forum pages.

 

I do have a way bigger problem right now though. Upon trying to log on to wp, I get this error (one of them related to simple press, 2nd to last):

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘sp_plupload_localization’ not found or invalid function name in /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/plugin.php on line 406

Warning: Cannot modify header information – headers already sent by (output started at /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/plugin.php:406) in /problem-with-post-edit-buttonome/exceller/public_html/wp-login.php on line368

Warning: Cannot modify header information – headers already sent by (output started at /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/plugin.php:406) in /problem-with-post-edit-buttonome/exceller/public_html/wp-login.php on line380

Warning: Cannot modify header information – headers already sent by (output started at /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/plugin.php:406) in /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/pluggable.php on line 680

Warning: Cannot modify header information – headers already sent by (output started at /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/plugin.php:406) in /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/pluggable.php on line 681

Warning: Cannot modify header information – headers already sent by (output started at /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/plugin.php:406) in /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/pluggable.php on line 682

Warning: Cannot modify header information – headers already sent by (output started at /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/plugin.php:406) in /problem-with-post-edit-buttonome/exceller/public_html/wp-content/plugins/simple-press/sp-startup/site/credentials/sp-credentials.php on line 14

Warning: Cannot modify header information – headers already sent by (output started at /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/plugin.php:406) in /problem-with-post-edit-buttonome/exceller/public_html/wp-includes/pluggable.php on line 876

 

LINE 406 is bolded below:

 

if ( !isset( $merged_filters[ $tag ] ) ) {

ksort($wp_filter[$tag]); $merged_filters[ $tag ] = true; } reset( $wp_filter[ $tag ] );

do { foreach ( (array) current($wp_filter[$tag]) as $the_ )

if ( !is_null($the_[‘function’]) )

call_user_func_array($the_[‘function’], array_slice($args, 0,

(int) $the_[‘accepted_args’])); }

while ( next($wp_filter[$tag]) !== false );

array_pop($wp_current_filter);

 

 

MA max99
max99
Member

Ok, that error has been fixed (my host vps.net made some changes). So now I turned everything off, w3tc and this other hybrid connect plugin.

 

Can you please check the forum page source code and let me know if jquery is being loaded correctly or if I’m missing something there (remember I removed the code to call the 1.5.2 version via the theme’s header.php file).

The enlarging/downloading of the images still doesn’t work.

 

Thanks for your patience.