get_post_ancestors
[WordPress] 親(先祖)の投稿IDを配列で取得できる関数 get_post_ancestors()
![No image](https://www.560designs.com/wp/wp-content/webpc-passthru.php?src=https://www.560designs.com/wp/wp-content/themes/mytheme2/img/articles_fig_default-514x207.png&nocache=1)
$ancestors = get_post_ancestors( $post->ID ); これで直近の親だけではなく、最深の先祖までの投稿IDを配列で取得できます。 <title>の場合なら、 $ti […]
- 1
- 0
- 0
$ancestors = get_post_ancestors( $post->ID ); これで直近の親だけではなく、最深の先祖までの投稿IDを配列で取得できます。 <title>の場合なら、 $ti […]