Modal image stopped working on v 9.7.3

Posted in: Newspaper
Post count: 38

I noticed that modal image stopped working after updating the theme to on v 9.7.3. Unfortunately I deleted the other themes and I can’t downgrade.

Modal image is active in the theme panel and post images points to the media file although when I click on an image I’ve got the error message “image can’t be loaded”. Could someone please help?

Post count: 20688

Hi,

From what I can see the full image is available, but when the image is clicked there is an extra parameter in the URL. So while the link to the full image is set properly
http://prntscr.com/nuqrsx
Clicking on it produces this URL – http://prntscr.com/nuqrzm which does not exist.

I have tested this on my end after the update, the modal seems to work same as before
http://prntscr.com/nuqsdj

There are some topics online mentioning such an issue, with “undefined” being added at the end of the URL, can’t say if this applies here or not. For example
https://techjourney.net/undefined-appended-to-url-causing-404-page-not-found-error/
You could try as a quick test, to deactivate all non-theme plugins, see if it works after doing this.

Thanks

Post count: 230

Anyone managed to fix this?

Post count: 90

I have the same problem, still unresolved 🙁

Post count: 38

Thank for your reply.

I investigated the issue further after reading the link you posted and I hope some others may find it useful:

– the issue in not linked to any plug in (I disabledthem all and no results)
– the issue is not linked to Chrome Complityly Extension/Plugin (same isse on all browsers/devices)
– The issue can’t be solved with redirect/undefined URL Back to Original Link Address (I added teh followin code to htaccess file with no result:
RewriteEngine On
RewriteRule ^(.*)/undefined?$ /$1 [L,NC,R=301] )
– The issue is not linked to hosting provider whatsoever (the investigated but there’s nothing wrong/unusual on their end)

I also noticed that for some post the modail image works and for other doesn’t, although the images have the very same settings

I hope someone can have a solution

Post count: 26

pls fix it!

Post count: 20688

We have identified an issue that happens when the general modal image setting is active, in the theme panel – http://prntscr.com/nvqeii That is the one causing it, disabling it solves the problem.
This issue and some others that were reported and acknowledged, are investigated as we speak and will be fixed. When they are a them update will be released.

If you would like to downgrade to the previous version we can provide it by email. Send us an email at contact@tagdiv.com. Sorry for all the inconvenience.

Post count: 230

Adding this to my functions.php file, or uploading it as a plugin worked for me:

// td modal img on all images
function add_responsive_class($content){
$content = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8");
$document = new DOMDocument();
libxml_use_internal_errors(true);
$document->loadHTML(utf8_decode($content));
$imgs = $document->getElementsByTagName('img');
foreach ($imgs as $img) {
$existing_class = $img->getAttribute('class');
$img->setAttribute('class', "td-modal-image $existing_class");
}
$html = $document->saveHTML();
return $html;
}
add_filter('the_content', 'add_responsive_class');

Also lets you use modal images if you use a CDN like I do. Here is proof of working: https://www.thenerdystudent.com/2019/05/newspaper-speed/

Post count: 38

How do you upload it as a plugin?

Post count: 230

Package it into a .php file, and either zip it and upload via WP Plugin area or upload it in a folder to your plugins folder.

Post count: 38

Thanks, I just tried but issue is still there for me

Post count: 230

My bad, turns out the files need to be linked like so: https://imgur.com/a/kcouZvg

Otherwise, the error occurs if the file isn’t linked.

Post count: 38

Yeah, all my picures are linked like that but still not working

Post count: 230

Maybe try enabling opening the image in the new tab box? I have that and I think it only works on those.

Not really sure tbh, just got some of mine working.

Post count: 47

Hi GiacomoLaw
Thanks for the info re the modal images. Just to let you know, I clicked on your link
https://www.thenerdystudent.com/2019/05/newspaper-speed/
and then on the Newspaper Speed Guide image in your article and the images worked.
I then clicked on your green ‘The Nerdy Student’ banner which took me to your blog post
‘Jetpack for WordPress Speed Guide’. Clicking on the image shows that the images from 6 to 10 don’t load up.
Great site though, full of interesting tips.

Post count: 230

Hi, thank you! The banner image takes you to the home page.

Just checked the homepage and the 6 – 10 images aren’t linking as I haven’t set them to link. Setting them to link in the media settings has fixed the issue.

I’m using this: https://github.com/GiacomoLaw/tagdiv-cdn-modal/blob/master/tagdiv-cdn-modal.php as I have a CDN, so I need to use that to fix it as Tagdiv haven’t allowed CDNs to be used with the modal.

Post count: 47

Hi
Hope you didn’t mind me pointing it out to you..
I will have a look at your link. I only have the issue with images used on the directory part on my site at the moment, using a plugin (I know, everyone’s favourite thing!) but I have just changed the way the images display for now…I am not technical so will wait to see what tagDiv offer and then refer to the guy does the clever stuff.

Post count: 230

No worries, that solution has just worked for my sites on Newspaper. Hope you manage to sort it out 🙂

Post count: 187

Still a problem with me as well. You can click on “edit” image and visibly see the “Modal Image” setting in the “off” position switch over to the “on” position.

The problem is it is apparently not staying in the “on” position.

Where we at on a fix? This is big for us.

Thanks

  • This reply was modified 7 years by bobbymc.
Post count: 187

Turning “modal image” off in Theme panel works – will we have to turn it back on after theme update addresses problem?

Post count: 35449

Hi,

There is a problem with general modal image in theme panel, please make sure that you deactivate it -> https://www.screencast.com/t/Nx6YmhF0
After that check to see if the image is set like in our documentation -> https://forum.tagdiv.com/modal-window/

This problem will be fix in the coming update.

Thank you!

Viewing 21 posts - 1 through 21 (of 21 total)
The forum ‘Newspaper’ is closed to new topics and replies.