• It would be very nice to be able to get an array of products instead of the complete standard output generated by the plugin. Is this possible?

Viewing 1 replies (of 1 total)
  • Thread Starter vespino

    (@vespino)

    The following gives a loop which can be used to do with whatever you want:

    $args = array(
    	'post_type'            => 'product',
    	'ignore_sticky_posts'  => 1,
    	'no_found_rows'        => 1,
    	'posts_per_page'       => 4,
    	'orderby' => 'recent_view_time',
    	'order'  => 'DESC',
    	'meta_query' => array(
    		array(
    			'key'     => 'recent_view_time',
    			'value'   => '',
    			'compare' => '!='
    		),
    	),
    );
    
    $recently_viewed_products = new WP_Query( $args );
    • This reply was modified 7 years, 3 months ago by vespino.
Viewing 1 replies (of 1 total)
  • The topic ‘get array instead of output’ is closed to new replies.