• Hey guys, the theme that I am currently using makes use of lightbox for image links on the frontpage. However, it is proving to be a problem for image links in individual pages and also news posts. There is an option to totally disable this feature but unfortunately it would mean that it will not work for the frontpage either.

    Currently, the only way that I can remove lightbox from image links within the pages and posts is by removing the “wp-image” tag from the CSS class of the image – This is an example:

    Before editing (text that needs to be deleted to disable lightbox is bolded):

    <a title="Link to another site" href="http://testing.com"><img class="alignnone size-full wp-image-2535" alt="Test Image" src="http://site.com.bn/wp-content/uploads/2013/06/testimage.png" width="700" height="300" /></a></p>

    After editing:

    <a title="Link to another site" href="http://testing.com"><img class="alignnone size-full">" alt="Test Image" src="http://site.com.bn/wp-content/uploads/2013/06/testimage.png" width="700" height="300" /></a></p>

    Some of our news posters are finding it confusing just to look at HTML so I was wondering if there was a better way to fix this.

    Any help is greatly appreciated, thanks in advance guys.

Viewing 1 replies (of 1 total)
  • The none code way is to disable that in your theme and use one of them plugins that offer this option from the plugin settings. I’m not sure if there is one but there are a lot of them.

    The other way is to look for a plugin that only apply the effect to the images in gallery only, not to all normal images. This is more preferable.

    Of you could do a research on how to conditionally enqueue/dequeue JS based on page and apply this hack to your theme.

Viewing 1 replies (of 1 total)

The topic ‘Template lightbox affecting image links in posts.’ is closed to new replies.