Post Formats - Gallery Format: the_remaining_content still contains the gallery
|Reported by:||Frank Klein||Owned by:|
If you use the_post_format_gallery() along with the_remaining_content(), the gallery will be displayed twice.
As far as I see, the only way to output a gallery separately from the rest of the post content is to use get_content_galleries():
$post_content = get_the_content(); $gallery = get_content_galleries( $post_content, true, true, 0 ); echo $gallery; echo apply_filters( 'the_content', $post_content );
This differs from the implementation for audio, video and images, as the_remaining_content() strips the media from the post content before display. the_remaining_content() should do the same with galleries.
Change History (5)
- Keywords has-patch dev-feedback added
- Milestone changed from Awaiting Review to 3.6
comment:3 wonderboymusic — 6 months ago
- Milestone 3.6 deleted
- Resolution set to invalid
- Status changed from new to closed