aldolat
Member
Posted 2 years ago #
In myself-created theme, I use the image.php attachment template to display my images in a larger size.
Now, I would to add this nice feature to display my videos in a dedicated template and I would to use the video.php file.
I already created the video.php, but I didn't understand how to make WordPress use this template.
May I know how to proceed?
WordPress should pick up the new attachment template automatically.
http://codex.wordpress.org/Templates_Hierarchy#Attachment_display
aldolat
Member
Posted 2 years ago #
Nope. :(
When I add a movie file (e.g., movie.mp4), wordpress writes only this contruct:
<a href="path/to/movie.mp4">video</a>
and the link send me directly to the file. The image.php is not used.
When you insert it, are you remembering to select "Post URL"?
aldolat
Member
Posted 2 years ago #
Thank you esmi for the tip! I didn't see this option. ^^
Now wp uses video.php if I upload an mp4 video.
But if I upload an ogg video, wp doesn't use video.php. I think this is due to the fact that wp doesn't recognize the ogg mimetype.
Do you know in which file I can add this extension without using any plugin?