‘mgoods’,
‘orderby’ => ‘id’,
‘order’ => ‘ASC’
);
$catlists = get_categories( $catargs );
foreach($catlists as $cat) : // 取得したカテゴリの配列でループを回す
$args = array(
‘category’ => $cat->term_id
);
$cat_name = $cat->name;
print “

“;
print $cat_name;
print “

“;
$query_str = ‘post_type=mgoods&taxonomy=mgoods&showposts=10&order=DESC&term=’ . $cat->slug;
query_posts( $query_str );
$count = 1;
if (have_posts()) :
echo “

“;
while (have_posts()) : the_post();
print “

“;
print “

“;
print “

“;
print “

“;
print “

“;
print “

“;
//画像をHTMLで取得する
$photo01 = get_post_meta(get_the_ID(), ‘商品写真’, true);
$image01 = wp_get_attachment_image_src($photo01, ‘full’);
$image_url01 = $image01[0];
$title = get_the_title($post);
if( $image_url01 != “” ){
print ““;
print “\""“;
print “
“;
}
print “
“;
if( $title != “” ){
print “” . $title . “
“;
}
// 本文データ取得
$content = get_the_content();
print nl2br($content);
print “

“;
endwhile;
echo “

“;
endif;

wp_reset_query();

endforeach; // カテゴリのループ終わり
?>