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