I tried to run a query inside a class
this was the structure
namespace NCK{
class Runquery{
public function execute(){
$query= new WP_Query(array(..............));
return $query;
}}}
But when i used
$getvalue = new NCK\Runquery();
var_dump($getvalue->execute());
It throws an error
Fatal error: Uncaught Error: Class ‘NCK\WP_Query’ not found in
is there any way i can make it works?