in_the_loop() issue with custom query

in_the_loop() issue with custom query