PrettyPhoto is a media lightbox that allows its users to open up media content in beautiful frames. A lot of WordPress themes and plugins come with PrettyPhoto already included in them.
How Does PrettyPhoto Work?
The way PrettyPhoto works is that it adds a
So, for example, if you add a media to your post with the following code:
<a href="large_image_url"><img src="small_image_url" width="x" height="y" /></a>
then PrettyPhoto will add the
<a rel="prettyPhoto" href="large_image_url"><img src="small_image_url" width="x" height="x" /></a>
Let me show you how this works on a real life example:
To disable the PrettyPhoto effect on this particular image, I have to add
<a rel="no_prettyPhoto" href="large_image_url"><img src="small_image_url" width="x" height="y" /></a>
Let’s take a look at the difference…
This image doesn’t open in a nice lightbox. But rather it opens up in its own tab which is both less useful and less pleasing to the eye.
When and How to Suppress PrettyPhoto
But sometimes it is necessary to use the
For example, when I create a link to a post of mine that ends with
You can try it out yourself:
How to Use Image Formats Correctly — GIF, PNG, or JPG.
The error doesn’t occur when I omit the
But after I add the
Suddenly, the link works as it should.
Of course, there might be other, completely different reasons for suppressing PrettyPhoto, too.
Liked this post?
Subscribe to our newsletter to receive early notification of new posts and deals: