• hi.
    1) How can I add a video format .mp4 with my hosting, so they are also easily integrated into the video grid on the main page?
    2) your theme does not support video thumbnails? How to add video thumbnails?

    • This topic was modified 6 years, 10 months ago by yurichar.
    • This topic was modified 6 years, 10 months ago by yurichar.
Viewing 1 replies (of 1 total)
  • Theme Author tubegtld

    (@tubegtld)

    1) How can I add a video format .mp4 with my hosting, so they are also easily integrated into the video grid on the main page?

    You can upload MP4s into the media library just like images.

    2) your theme does not support video thumbnails? How to add video thumbnails?

    There are a few ways to do this.

    a) Create a “post-list.php” partial in your child theme using the one in the main theme as a starting point. Modify as needed.

    b) Put a filter on the_post_thumbnail and modify the resulting html output in there to include your MP4. Something like this (NOT TESTED) example…

    function modify_post_thumbnail_html($html, $post_id, $post_thumbnail_id, $size, $attr){
        // gets the id of the current post_thumbnail (in the loop)
        $post_id = get_the_id(); 
    
        // had MP4 thumbnail
        $mp4_url = get_post_meta( $post_id, 'my_custom_field_w_mp4_url', true ); 
    
        // if no mp4, do nothing
        if ( ! $mp4_url ) return $html;
       
        // generate the thumbnail HTML that includes the video player
        $html = 'YOUR MP4 HTML SNIPPET';
    
        // send it back
        return $html;
    }
    
    add_filter('post_thumbnail_html', 'modify_post_thumbnail_html', 99, 5);
Viewing 1 replies (of 1 total)
  • The topic ‘creating a video grid on the main page’ is closed to new replies.