How to make image modal default

Posted in: Newsmag
Post count: 115

Hi.

Is there anyway you can make insert image to “Modal:On” as default. I don’t know if its a theme or wordpress thing.

Post count: 7909

Hi,

The theme has an option to enable/disable lightbox for featured images in Theme Panel > Post Settings – http://screencast.com/t/6lG3BiJZ9o but for your content images there is not a general option to enable modal, you will have to enable it for each image – http://screencast.com/t/fLfjfSvchttp://screencast.com/t/N82loiZ9E
We work on this and try to find a solution to force the modal for all post content images and add an option in Theme Panel.

Thanks!

Post count: 115

Thanks in advance. Since we use Template 7, the featured image is not in play for us

/Jens

Post count: 31

Which lightbox plugin do you suggest?
I was using WP Lightbox 2, but it is not compatible with the latest update.

Post count: 780

@Cagatay the theme comes with a custom designed lightbox. Use the one from the theme is well tested and hopefully we will release the update that allows for site wide lightboxes soon.

Post count: 52

I was using “Responsive Lightbox” plugin but it is also not compatible. Please either realease a compatible template or enable Modal:On for all images in settings. If you had thousands of images, you cannot do it one by one. A soon update of this will be appreciated.

Post count: 10

here is the thread with a solution until something the theme provides, it works for me as I also didn’t want to go through hundreds of images. (thanks to historiek)
https://forum.tagdiv.com/topic/modal-image-default-on/

1) Place this code in functions.php

// include theme.js
//
wp_enqueue_script( 'theme-js', get_stylesheet_directory_uri() . '/js/theme.js', array( 'jquery'), NULL, TRUE );

2) Create a theme.js-file with this code:

jQuery( document ).ready( function ($) {

if ( $( document.body ).hasClass( 'single' ) ) {

$( '.td-post-text-content figure > a img' ).addClass( 'td-modal-image' ) ;

}

} ) ;

3) Upload theme.js to the specified folder (i.e.: wp-content/themes/Newspaper/js/)
  • This reply was modified 11 years by cem.
Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newsmag’ is closed to new topics and replies.