親の存在があるかチェックする。なければその記事は単体。
//親の存在チェック
function is_parent_slug() {
global $post;
if ($post->post_parent) {
$post_data = get_post($post->post_parent);
return $post_data->post_name;
}
}
親の存在があるかチェックする。なければその記事は単体。
//親の存在チェック
function is_parent_slug() {
global $post;
if ($post->post_parent) {
$post_data = get_post($post->post_parent);
return $post_data->post_name;
}
}