Prevent images from open in mobile

Posted in: Newspaper
Post count: 16

Hi, I need to prevent the modal image from being clickable on the mobile version (using mobile theme plugin).

I’ve tried
.td-post-content .td-post-featured-image {
pointer-events: none;
}
but didnt work (did work for the featured but not for the images in the post content)

Appreciate your help.

Thanks

Post count: 22421

Hello,

Unfortunately there is no simple way of removing the theme modal image for a particular viewport. The modal is added with js. It can be removed by using this script:

if(window.matchMedia("(max-width:767px)").matches) {
jQuery(document).ready(function ($) {var magnificPopupEnabled = false;$.extend(true, $.magnificPopup.defaults, {disableOn: function() {return false;}});});
}

The image will open in the wp default implementation after removing the lighbox.

Thanks

Post count: 16

Hi Bogdan, Thanks for the response! But the real problem is I want to prevent any opening but the lightbox.

I believe I maybe have explained wrong or too briefly.

My first choice for the images on my site is to open in lightbox, so I’ve enabled the modal image option.

As it’s impossible to implement the lightbox with the mobile theme, I prefer they don’t react at all to the point (click) in mobile.

Now, with the modal enabled, the images open as you said and I definitely don’t want that.

I hope you can help me.

Thanks

Post count: 23312

Hello Abrime,

Unfortunately, as you wish to achieve involves doing such deeper customization and we cannot provide something like this at the moment, sorry!

Thanks for your understanding!

Post count: 16

Hey Catalin,

I’m really sorry to hear that.

As it’s doable with the featured image, I thought it could be the same with the images in the post.

Do you know another way for me to achieve something similar?

It would be: lightbox on desktop and “static” image in mobile (i’d prefer lightbox on mobile but is impossible with the mobile theme)

Thanks in advance

Post count: 23312

Hello Abrime,

Unfortunately, the theme does not have any such options that allow you to do that, sorry! Try to find such a plugin with this functionality and try their functionality but please notice that Mobile Theme was custom made and it’s possible does not work.

Thanks for the message!

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