最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - How to get the POST TITLE using the POST ID?

programmeradmin2浏览0评论

I made a page with several POST IDs that I get from the Table of a plugin.

Now the page is showing like: 3249 3250 3251 3252 (Post IDS)

I wanna show the title of those IDs like

3249 - POST TITLE OF 3249 3250 - POST TITLE OF 3250

etc...

I made a page with several POST IDs that I get from the Table of a plugin.

Now the page is showing like: 3249 3250 3251 3252 (Post IDS)

I wanna show the title of those IDs like

3249 - POST TITLE OF 3249 3250 - POST TITLE OF 3250

etc...

Share Improve this question asked Apr 3, 2020 at 15:47 Philip KavPhilip Kav 191 silver badge2 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

WordPress has a ton of the get_the_*() functions which you can pass an ID and return a value you're looking for. In this case you can call get_the_title() which returns the title of a post. An example could look like:

echo get_the_title( 3249 );
发布评论

评论列表(0)

  1. 暂无评论