タグ

tipsに関するosanpo_uのブックマーク (1)

  • WordPressDesign

    例)カテゴリIDの7が「間取り」で、その子カテゴリである「1DK」「1LDK」「2LDK」などを取得する場合。 // 間取りカテゴリ取得 function get_cat_madori() { global $post; foreach((get_the_category($post->ID)) as $tmp_cat) { // 親カテゴリが「間取り」か? if ($tmp_cat->parent == 7) { return $tmp_cat->name; } } return ""; } 256design テンプレートタグ

  • 1