<?php //親のカテゴリがあれば 親の名前を出力する
//カテゴリー・タグ情報を取得(slug,アーカイブページでターム名取得,タクソノミー名取得)
$term = get_term_by('slug',get_query_var( 'term' ),get_query_var( 'taxonomy' )
);
?>
<?php //$termにはいってる情報で分岐
if ( $term->parent ): // 親IDが入ってれば (子だったら)
$ido= $term->parent;
$taxs = get_query_var( 'taxonomy' );
$term2 = get_term($ido,$taxs);
$oya = $term2->name;
$oyaurl = get_term_link($term2->slug,$taxs);
?>
<h1 class="top_titel" style="padding-top:30px; text-align:center">
カテゴリ:
<a href=" <?php echo $oyaurl ?>">
<?php echo $oya;?></a> >
<?php single_term_title(); ?>
</h1>
<?php
else: //親だったらそのまま出力
?>
<h1 class="top_titel" style="padding-top:30px; text-align:center">
カテゴリ:
<?php single_term_title(); ?>
</h1>
<?php endif ?>