这是我的代码,它不起作用。
global $post;
echo get_the_title( wp_get_post_parent_id( $post->post->ID ) );
Run Code Online (Sandbox Code Playgroud)
但这不起作用。
先感谢您。
小智 7
对于父页面 id
<?php
echo wp_get_post_parent_id(get_the_ID());
?>
Run Code Online (Sandbox Code Playgroud)
小智 6
对于父页面 ID
$post->post_parent;
Run Code Online (Sandbox Code Playgroud)
对于当前页面标题
$post->post_title;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
20014 次 |
| 最近记录: |