Modal image default On

Posted in: Newspaper
Post count: 6600

Hi,

I have checked your site source and noticed that the theme.js file isn’t loaded so make sure that you also use this code in functions file: http://screencast.com/t/46XEazZE
Make sure you do this in the main theme.

Thanks

Post count: 102

@Lucian, it’s there. Here is a screenshot: http://screencast.com/t/7ZbJYC1i

Post count: 54

#34453

i make what you told me in :
image to link to media: http://screencast.com/t/9dJcfGM0z

nothing change
All Image could not be loaded .

http://prntscr.com/5sorai

what can i do !

Post count: 6600

Hi,


@ned4spd8874
I can see that the script file is loaded now and the modal view works on your posts: http://screencast.com/t/2Odn6l2zI

@iha
Please check this by adding a new image and set it to media. Also provide your site’s URL so I can check this.

Thanks

Post count: 102

Yeah, I got it working last night. I don’t know what’s different though. I did nothing that I didn’t do before.

Thanks for all the help!

Post count: 39

I am having issues with this also. The theme.js is loading but it does not seem to be working

Have a look here:

http://www.cgmagonline.com/dev/?reviews=housebound-movie-review

for some odd reason it does not want to load.

Any ideas?

Post count: 6600

Hi,

I see you use newsmag theme while this is for newspaper theme. Try to change the post content class like this: http://screencast.com/t/t6801NVB and also make sure you add the enqueue script function in the functions file: http://screencast.com/t/wibhUnZ1u

Thanks

Post count: 39

Okay,
still no dice

Maybe I have the code a little wrong.

Here is my theme.js:

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

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

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

}

} ) ;

and here is the part from the functions file:

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

// for debugging, see all hooks
//add_action( 'all', create_function( '', 'var_dump( current_filter() );' ) );

maybe I am missing something

here is the dev site:
http://www.cgmagonline.com/dev/?reviews=nintendo-new-3ds-xl-hardware-review

Post count: 39

Okay, it seems it now works! I spoke to soon!

Thanks for all the help!

Post count: 102

I’ve got a new wrinkle and I’m hoping someone here can help. So the script is working fine. However, I have a post that I need to have modal turned off for image linking. Is there a way I can force modal off for specific posts?

Post count: 102

I’m going to have to undo this if I can’t fix the image links. I just found that certain ads are not working properly. When clicked on, instead of going to a page, it tries to open up lightbox and says “The image #2 cannot be loaded”.

If anyone shows ads, it seems you can’t do this unless a workaround is found.

Post count: 19

Hello ,
i have added this fix and its working for me , but my question will this effect google adsense …? meaning will this make teh adsense also open in modal or just pictures?
thanks

Post count: 13

It only works for captioned WordPress-images. Adsense will open normally.

Regards, Yuri

Post count: 10

hi,
maybe someone can help. This solution unfortunately has impact on plugins e.g. social media feather where the icons are treated as any other image and lightbox kicks in so sharing is not possible even so $class_extra .= ' nolightbox'; is part of the plugin code. IS there a possibility to restrict to media formats like jpg but exclude png

thx

Viewing 14 posts - 26 through 39 (of 39 total)
You must be logged in to reply to this topic.