How to Replace the Video Player, Audio Player or Gallery with Your Own Code
Foxiz builds the player at the top of a video post, the player of an audio post or podcast episode, and the slider of a gallery post itself. Three filters let you swap that markup for your own: a different video player, extra links under the audio, a plain image grid instead of the slider. Everything else on the post stays as the theme draws it.
This is a developer task. You add a few lines of PHP to your child theme; nothing changes in Theme Options.
Before you start
- Install and activate the Foxiz child theme, as Using Child Theme explains. Code you add to the parent theme is lost at the next update; code in the child theme is not.
- Open the child theme's
functions.php, either over FTP or at Appearance > Theme File Editor with Foxiz Child selected. Every example below goes at the end of that file. - Have one test post of each kind you are changing. The video filter only runs for a post whose Post Format is Video; the box in the post editor reminds you of the same thing above its Video URL field.
What each filter receives and returns
| Filter | Receives | Return |
|---|---|---|
foxiz_video_embed | $embed: the player HTML, or null when the post has no video; $post_id | the HTML to print, or null for no player |
foxiz_audio_embed | $embed: the player HTML with its wrapper, or null; $post_id; $autoplay: true when the player is asked to start on its own | the HTML to print, or null for no player |
foxiz_gallery_embed | $pre: always null; $post_id; $layout: slider, carousel or coverflow; $crop_size: the image size the layout would use | null to let Foxiz draw the gallery, or a string to print in its place |
Whatever you return is printed exactly as it is, without escaping. Escape every URL and piece of text you put into it yourself, with esc_url(), esc_attr() and esc_html(), as the examples do.
The video filter
$embed is what Foxiz found in the post's Video Format box, tried in this order: an uploaded Self-Hosted Video plays in the browser's own player; otherwise the Video URL goes through WordPress's embed lookup (YouTube, Vimeo, DailyMotion); and if that finds nothing, the Iframe Embed Code is used.

Your HTML goes inside the theme's own pvideo-embed and embed-holder boxes, so the sizing and the floating video keep working around it. Returning null or an empty string removes the player, and Video Layout 2 then sizes its header for a post without one.
The filter changes the player in every video layout and in the Foxiz - Post Featured Image block of a single post Ruby Template. It does not touch the Preview Video that plays over the featured image in blog listings.
The audio filter
The audio filter works the same way, with two differences. $embed already carries its wrapper: the theme's <audio> player for a Self-Hosted Audio file, or an external-embed box around the SoundCloud or MixCloud player. And it runs for podcast episodes too, on the episode page and in the episode players of podcast listings.