post_parent ) && $image->post_parent != $id ) $url .= '#image-attachment-anchor'; return $url; } endif; add_filter( 'attachment_link', 'mixfolio_enhanced_image_navigation', 10, 2 );