Support » Fixing WordPress » How to use the video.php attachment template

  • 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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    Forum Moderator

    WordPress should pick up the new attachment template automatically.

    http://codex.wordpress.org/Templates_Hierarchy#Attachment_display

    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.

    esmi

    (@esmi)

    Forum Moderator

    When you insert it, are you remembering to select “Post URL”?

    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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to use the video.php attachment template’ is closed to new replies.