Title: Getting First Video/Audio from Post
Last modified: August 21, 2016

---

# Getting First Video/Audio from Post

 *  [Neji87](https://wordpress.org/support/users/neji87/)
 * (@neji87)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/getting-first-videoaudio-from-post/)
 * Hi,
 * I’m trying to code some templates for the post formats feature and all has gone
   well until I’ve finally reached the content-video.php file.
 * Basically, I’m trying to follow the post formats uses posted on the WordPress
   Codex – so all I want to do is grab the first video/audio file from the post 
   and display the media player.
 * Anyone have any ideas on how to achieve this?
 * I was planning to scan the content with PHP’s preg_match but there’s no obvious
   starting and ending point to the video to use.
 * I’m using the media player included in WP core btw.

The topic ‘Getting First Video/Audio from Post’ is closed to new replies.

## Tags

 * [media](https://wordpress.org/support/topic-tag/media/)
 * [video](https://wordpress.org/support/topic-tag/video/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [Neji87](https://wordpress.org/support/users/neji87/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/getting-first-videoaudio-from-post/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
