[wp-trac] [WordPress Trac] #39147: Single.php and post formats - wrong content

WordPress Trac noreply at wordpress.org
Wed Dec 7 14:26:05 UTC 2016

#39147: Single.php and post formats - wrong content
 Reporter:  gwgw          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Post Formats  |    Version:  4.7
 Severity:  normal        |   Keywords:
  Focuses:                |
 In my single.php file i'm trying to get content, for specific post format
 using get_teplate part.
  Example, single.php file:
 get_template_part( 'template-parts/single-post/content',get_post_format()

 In my template-parts/single-post subfolder i have:
 content.php - for standard posts, content-aside.php for aside and so on...
 In this files i'm using:

 To get content from database...and its not work,
 when i use the_excerpt();
 i'm getting excerpt from previous post, not the current one.

 Now, not-funny thing:
 When i delete single.php and use index.php with:
 get_template_part( 'template-parts/single-post/content',get_post_format()
 Everything works fine, i get proper content for proper post format,
 its like i can't use: get_post_format() inside single.php
 Is it bug, or only custom theme problem?

Ticket URL: <https://core.trac.wordpress.org/ticket/39147>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list