Black Friday sale! Get 25% off WPSP Pro! Discount automatically applied at checkout.

[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: 

Viewing 15 posts - 1 through 15 (of 20 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 1 year, 3 months 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 year, 3 months 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 🙂

    #13338
    Tom
    Participant

    Hi there,
    i would like to do the same.
    I have a page for a certain category.
    And i have posts for that category which are either about a video or about an image.
    Then i would like to show the posts (with optional excerpt) and be able to play the video or just display the image.

    Is that possible with WPSP?
    Could you please explain the steps Cris did here to get his results with a little more detail. So i as a total newbie can reproduce them?

    Thanks,
    Tom

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