WordPress.org

Forums

How to use the video.php attachment template (5 posts)

  1. aldolat
    Member
    Posted 5 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?

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    WordPress should pick up the new attachment template automatically.

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

  3. aldolat
    Member
    Posted 5 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.

  4. esmi
    Forum Moderator
    Posted 5 years ago #

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

  5. aldolat
    Member
    Posted 5 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?

Topic Closed

This topic has been closed to new replies.

About this Topic