我从查询中得到以下结果:
Techn1
Techn2
Tech3车队
Techn2
Techn2
我想通过Tech#以结果
的方式对结果进行分组Techn1
Techn2
p22 some text
p52一些文字
p62一些文字
Tech3车队
这是使用过的代码:
$vars = new WP_Query( array( 'category_name' => 'actualite'));
while ( $vars->have_posts() ) : $vars->the_post();
$child_posts = types_child_posts("contenu");
foreach ($child_posts as $child_post) :
if($child_post->fields['theme']=='A'):
$technique =$child_post->fields['f1'];
if (@$lastTechnique != $technique):
print "<strong>".$technique."</strong><br>";
endif;
echo "- ".$child_post->fields['f2']." Some text : ".$child_post->fields['f3']." (some text : ";the_title();echo ")<br>";
else:
echo "";
endif;
endforeach;
endwhile;
答案 0 :(得分:-1)
$ext = pathinfo($file["name"], PATHINFO_EXTENSION);
$destinationName = sha1_file($file["tmp_name"]).time().".".$ext;