如何在 WordPress 中获取当前页面标题?

aza*_*ing 0 php wordpress

我在WordPress中使用22主题。有人可以告诉我,如何获取当前页面标题功能?。

我尝试了这个功能,但它给了我帖子标题而不是页面标题。谢谢。

    <?php echo get_the_title();?>
Run Code Online (Sandbox Code Playgroud)

Sev*_*Jr. 5

wp_title()

欲了解更多信息:
https ://wordpress.org/support/topic/how-to-display-page-title-not-the-post-title

  • `wp_title('');` 使用它来摆脱 &gt;&gt; (4认同)