I have a photographic portfolio site.when image on single.php page is clicked the_content() function is called and user is redirected to the actual directory of the image
eg; http://www.abcxyz.com/wp-content/uploads/2011/10/311565_33735319633456038_270235255_n.jpg
I want users to be redirected to next/other post on image click, and ‘m not getting the anchor tag in core wordpress files that i need to change, can anyone help?
Ok so I wanted to do this WordPress style and not hack it with jQuery. So here’s what you can use in your functions.php. I think it should do what you’re looking to do:
So the function my_the_content_filter grabs the post’s content and the next post’s link. Uses regex to replace the hrefs wrapped around images in the content with the link to the next post. Then you add the filter to the_content function.
Hope that works for you!