How to open image in a page with advert?
I want to open image from an album in a page where I can also display an advert, similar to this page. Clicking on any picture from this album opens the image in a page that contains some links (adverts). I also want to do the same for my site. How can I do this?
The link sample you provided is not opening images, it is opening a new webpage.
That said, you can configure your thumbnail to open a new webpage that has a full-size image with ads and other content.
However, since your thumbnails are opening an image directly, consider using 1 of many lightbox clones that are available. In particular, you will want one with iframe capability to show your ad content. Some are available as a WordPress plugin too.
Reference: Lightbox Clone Matrix
To clarify: The lightbox clone will be opening a unique webpage that has a very large image along with your ad, which is why the iframe player is used, whenever a thumbnail is clicked on.