Thanks Rachel, your plugin have saved me a lot of work… this solution is kinda weird because it only works with WP_Query() but not with get_posts()
I was trying to use get_posts() instead because its more recommended to use to start a loop inside another loop.
But didn’t have success, so I had to use WP_Query() and now it works like a charm.
You’ve got to check why it doesn’t work with get_posts()