1
2
3
4
5
6
7
just change

<a href="<?php echo $direktlink; ?>" rel="<?php echo $bigpic; ?>">

to

<a href="<?php the_permalink() ?>" rel="<?php echo $bigpic; ?>">