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
@Lucian, it’s there. Here is a screenshot: http://screencast.com/t/7ZbJYC1i
#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 .
what can i do !
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
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!
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?
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
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
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?
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.
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
