Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

m_visited

// WP_Query arguments
$args = array (
	'post_type'              => 'product',
	'post_status'            => 'publish',
	'meta_query'             => array(
		array(
			'key'       => 'visited',
			'value'     => '1',
			'compare'   => '>',
			'type'      => 'NUMERIC',
		),
	),
	'cache_results'          => true,
	'update_post_meta_cache' => true,
	'update_post_term_cache' => true,
);

// The Query
$m_visited = new WP_Query( $args );