如何获取带有页面ID的页面标题?
2 个回答
- 投票数
-
-
- 2020-02-22
<?php echo get_the_title( get_the_ID() ); ?>
get_the_title根据特定ID提取WordPress帖子的标题.和get_the_ID()获取该页面/帖子的ID
<?php echo get_the_title( get_the_ID() ); ?>
get_the_title fetch the title of WordPress post based on particular Id. and get_the_ID() fetch id of that page/post
-
嗨,Anurag Tiwari.感谢您为WP Stack Exchange做出的贡献.正如一个使您的答案更全面的友好建议一样,我鼓励您对文档中的函数进行一些上下文说明或解释和/或引用.Hi, Anurag Tiwari. Thanks for contributing to WP Stack Exchange. Just as a friendly suggestion to make your answers a little bit more compreensive, I encourage you give some context or explanation and/or references to the function in documentation.
- 0
- 2020-02-22
- Celso Bessa
-
谢谢你的建议.下次我会做同样的Thanks for the suggestion. Next Time I will do the same
- 0
- 2020-02-24
- Anurag Tiwari
我的页面ID是:
30601
如何获取此ID的标题?
我想获取具有ID的页面标题.