[wp-trac] [WordPress Trac] #28243: If a static page is used as the "Posts page", the page's metadata is not availible

WordPress Trac noreply at wordpress.org
Wed May 14 16:58:56 UTC 2014


#28243: If a static page is used as the "Posts page", the page's metadata is not
availible
--------------------------+------------------------------
 Reporter:  Kelderic      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  3.0
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:  template
--------------------------+------------------------------

Comment (by Kelderic):

 That does work on `index.php`, thanks! Also tested `get_the_ID()`, and it
 behaves the same as `$post->ID`:

 `$post->ID` - Replaced by sub loop on `index.php`.
 `get_the_ID()` - Replaced by sub loop on `index.php`
 `get_queried_object_id()` - Correctly grabs page's ID on `index.php`


 The Codex documentation of `get_post_meta()` mentions using `$post->ID`
 and `get_the_ID()`, but not `get_queried_object_id()`. Adding something
 there would clarify which to use under different circumstances. Would I
 need to open a new ticket?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28243#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list