[Resolved] WPSP with videos

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support WPSP with videos

Tagged: 

This topic contains 13 replies, has 2 voices, and was last updated by  Tom 1 month, 2 weeks ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #10618

    Cris
    Participant

    Hi,

    I would like to do WPSP with videos. Is it possible?

    #10624

    Tom
    Keymaster

    Hi there,

    Are you wanting to replace your featured images with videos?

    Let me know 🙂

    #10625

    Cris
    Participant

    Hi there,

    Yes! Something like this

    #10637

    Tom
    Keymaster

    How would you define the video? Using a custom field.

    I can’t find any plugins for it, so it’s likely necessary to un-hook the current image and hook in the video (depending on where it’s coming from).

    #10648

    Cris
    Participant

    I created the Custom Post Type “video” and it contains the Custom Field “videoyou”
    Could you help me to unhook the image and hook the video, please?

    If possible, the idea I have is that in the WPSP list, when clicking on the video it will be reproduced and, when clicking on the title, it goes to the corresponding page link.

    • This reply was modified 2 months, 1 week ago by  Cris. Reason: clarify content
    #10661

    Tom
    Keymaster

    So first you’ll want to disable the images in your list settings.

    Then add this PHP:

    add_action( 'wpsp_before_header', function() {
        $video = get_post_meta( get_the_ID(), 'your_field_name', true );
    
        if ( $video ) {
            echo $video;
        }
    } );

    This assumes that the custom field has the full video HTML.

    #10666

    Cris
    Participant

    Thank you very much Tom!
    Your code works but, instead of the video, there is only the link of the video with the title. You know why?

    #10691

    Tom
    Keymaster

    Hi there,

    Does your custom field include the full HTML for the video?

    #10900

    Cris
    Participant

    Hi Tom,
    I do not understand your question.
    I created an oEmbed field in AFC plugin. It is necessary to include the full html.

    #10903

    Tom
    Keymaster

    What if you use a regular text/textarea field and include the full <iframe> element for the video?

    #10915

    Cris
    Participant

    Works! Thank you!
    But now I need to keep the 16:9 ratio because now they deform depending on the size of the window. Is it possible?

    • This reply was modified 1 month, 2 weeks ago by  Cris.
    #10922

    Tom
    Keymaster

    You would need to do this: https://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php

    Look for the <iframe> Video (YouTube, Vimeo, etc.) section.

    #10942

    Cris
    Participant

    Perfect!! Thanks you!!

    #10954

    Tom
    Keymaster

    No problem 🙂

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.