Added description for clarification
Removed $wp_query reliance
Replaced get_the_ID() with get_queried_object_id()