Oh thank you so much!. I completely missed that button, that fixed everything.
Thanks so much for sharing this !!. I will try it out to confirm since I didn’t check the code on newest updates.
-
This reply was modified 7 years by
tecnogaming.
It is nor working for me. The magnific popup on this theme keeps showing up. They should make a single button to disable this on the theme.
Ok. I found where the td-modal-image gets added an it’s inside wp-booster folder.
Modifying this would require serious work so I found out a much simpler alternative.
Adding this piece of code to a new php file (as a plugin)
function add_image_responsive_class($content) {
global $post;
$pattern =”/<img(.*?)class=\”(.*?)\”(.*?)>/i”;
$replacement = ‘<img$1class=”$2 td-modal-image”$3>’;
$content = preg_replace($pattern, $replacement, $content);
return $content;
}
add_filter(‘the_content’, ‘add_image_responsive_class’);
Will succesfully restore the GLOBAL MODAL ON on all images while using a CDN plugin. This code works perfectly with either wp-supercache CDN functionality or KeyCDN CDN Enabler plugin.
You could adapt the code to include it on your theme if you like, this will improve functionality by allowing the use of any CDN and the Global MODAL mode enabled.
(For this code to work you need to disable Global MODAL on Theme options)
-
This reply was modified 8 years by
tecnogaming.
Just so you know. The theme work just fine with CDN77 and MaxCDN using CDN Enabler plugin from KeyCDN and wp-supercache. It’s only the global td-modal class that is not getting added when you enable the CDN URL as I explained above.
I understand what you recommend. But I cannot just ditch a suscription to MaxCDN just because you don’t want to support a CDN outside of Cloudflare.
It would really help if you can point me where is the td-modal class being added in the PHP code so I can take a look and probably fix it.
Afterall, having support for all CDN’s in your theme would certainly not harm you in any way.
Please, take your time to read what I’ve just posted. This is not something I have trouble configuring it.
I am telling you about a BUG I found in the theme. I’ve been using all kinds of themes and I’ve never seen a CDN configuration breaking the theme like in this one.
You can’t just send someone to use Cloudflare when the theme functionality breaks while using a recommended plugin of yours. wp-supercache.
I am using wp-supercache with CDN and maxCDN. Why would I want to use cloudflare?. I am already paying cloudflare ARGO and I have a separate MaxCDN account for the pictures.
This should be working just fine.
The problem ocurrs when I activate the CDN functionality on wp-supercache, you recommend this plugin and I am telling you the CDN functionality breaks the the theme functionality. This should not be happening.
Of all the CDN’s out there, cloudflare is THE ONLY ONE that does not need domain replacing to work, as they use their own DNS services and they can get away with it but all the rest needs some form of plugin for URL replacing.
The problem starts when wp-supercache replaces the URL of my site with the cdn.mysite.com. The class for MODAL that the theme should be added gets deleted. All I’m telling you is that I need a hint as to where the class gets added so I can try and modify the theme files and see if I can make it work.
Of course, you’re invited to explore this bug and replicate it yourself, you’ll see that I’m right.
That’s exactly my problem. I want the modal to be ON by default. When I inspect the code on my website it does not add the modal class. I have to insert an image, then go to edit the image and then click on the “ON” button on the Modal for the image to be able to zoom properly.
I want to be able to open all my images inserted with the modal by default but it always shows as OFF by default, even when I selected the “Default modal ON” on the Theme settings.
Yes when I click on said button, it works. But I have to do it each time for each picture because the button always shows as OFF by default.
What’s the point of a global ON if the button displays as OFF. I have to manually edit the picture I insert and click on that button.
Isn’t there a better method ?
If it is a gallery it will work just fine. But if I upload a single photo it won’t work.
Take a look at this review.
https://www.tecnogaming.com/2018/02/cougar-qbx/
The galleries are working but the single images are not. All our images are always link to media file instead of page attachments.
Same happening here. I disabled all plugins, set General Modal to ON yet every single image I upload comes with Modal OFF and I have to mnanually set it to ON.
What’s the point of a general setting that is not working?.
Can you please take look at this?