post_parent) && $image->post_parent != $id) $url .= '#main'; return $url; } add_filter('attachment_link', 'triad_enhanced_image_navigation', 10, 2);