I am trying to run the following code, which i got from the site but i don't see any output.When i do print_r($product) only then i get array back.

$args = array(  
    'post_type' => 'product',   
    'posts_per_page' => 4  
);  
$featured_query = new WP_Query( $args );      
if ($featured_query->have_posts()) :   
    while ($featured_query->have_posts()) :   
        $featured_query->the_post();  
        $product = get_product( $featured_query->post->ID );  
        echo $product;
    endwhile;     
endif;  

没有正确的解决方案

许可以下: CC-BY-SA归因
scroll top