How to run query inside a class with namespace?

You need to add a \ in front of the WP_Query call to tell PHP that it’s in the global namespace and not the namespace of this class.

Try this: $query = new \WP_Query($args);

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduedueduedueduedueduedusedu