[Resolved] Replace featured image with video

Home Forums Support [Resolved] Replace featured image with video

Home Forums Support Replace featured image with video

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #458259
    Mark

    Hello,

    I would like to replace featured images with videos. I’ve tried Featured Video Plus but it’s not working the way I want it to, so I’m building a custom solution.

    I’ve created a custom field for the video link ‘video_url’ and I want to replace the whole post-thumbnail code with this code:
    ‘<video class=”featured-video” src=”(link from video-url)” autoplay loop muted playsinline ></video>’

    Can you help me with php code?

    #458505
    Leo
    Staff
    Customer Support

    Hi there,

    That plugin is what we suggested: https://generatepress.com/forums/topic/video-thumbnail-instead-of-picture-in-generatepress/

    What isn’t working for you?

    #458793
    Mark

    With Featured Video Plus set at autoplay+loop, only one video at the time is playing. I want to replace gifs with mp4 videos and have more videos looping at one time.

    #458999
    Tom
    Lead Developer
    Lead Developer

    You could try using this filter: generate_featured_image_output

    For example:

    add_filter( 'generate_featured_image_output', 'tu_custom_featured_image' );
    function tu_custom_featured_image( $output ) {
        if ( get_post_meta( get_the_ID(), '_your_id', true ) ) {
            return 'your code';
        } else {
            return $output;
        }
    }
    #459082
    Mark

    Thank Tom!

    It’s working, you are amazing!

    #459410
    Tom
    Lead Developer
    Lead Developer

    Glad I could help! 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.