$result.='<table id="dp-table-'.$id.'" class="dp-table-shortcode dp-table-Container">'
. '<thead><tr>'.$table_head_cell.'</tr></thead>';
$result.='<tbody>';
while ($r->have_posts()) {
$r->the_post();
global $product;
$first = '';
$currentCategory = get_the_terms( $post->ID, 'product_cat' )[0]->term_id;
$result.='<tr id="displayProduct-' . $r->post->ID . '" class="dp_product_item dp-table-tr dp_category_'.$currentCategory.'">';
if($tablecolumnsArray):
foreach($tablecolumnsArray as $index=>$gridcolumn):
$result.= dp_table_body($index,$gridcolumn,$r->post->ID);
endforeach;
endif;
$result.= '</tr>';
$r = new Wp_query($args);
$r = new Wp_query(array(
...,
...
...
));
$args = array(
...
...
...
);
'order' => 'DESC',
'orderby' => 'date',