[wp-trac] [WordPress Trac] #29732: post_template.php get_the_content() incorrect work when run without get_header?

WordPress Trac noreply at wordpress.org
Tue Sep 23 11:53:11 UTC 2014


#29732: post_template.php get_the_content() incorrect work when run without
get_header?
-------------------------------+----------------------
 Reporter:  Skynin             |       Owner:
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:  invalid
 Keywords:                     |     Focuses:
-------------------------------+----------------------

Comment (by Skynin):

 Replying to comment:1 SergeyBiryukov:
 > `get_the_content()` should only be used inside the loop. Looks like
 you're trying to call it separately.
 Yes, I use outside the loop for a selected page. Global variable $post is
 initialized in this case, therefore i assumed that everything will work.

 Thank you for the answer.

 This ticket(#29732) can be removed.

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


More information about the wp-trac mailing list