[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 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #13352
    Tom
    Keymaster

    First, you’ll need to create a custom field. A plugin like this is great for that: https://wordpress.org/plugins/advanced-custom-fields/

    Then, you’d add your video HTML to the custom field.

    Lastly, you need to add this function, and change the custom field to the name you chose when you create your own custom field: https://wpshowposts.com/support/topic/wpsp-with-videos/#post-10661

    Hope this helps 🙂

    #15301
    Reagan
    Participant

    I’ve installed the custom field.
    In my custom field I am using iframe code for the video.
    I tried adding the php using a php plugin (using Code Snippets Version 2.14.0 | By Code Snippets Pro).
    Under WP Show Posts I have made sure the check box for images is unchecked.

    I still can’t get the playable video to replace an image. I am not using a featured image. Is the problem how I’ve added the php code? Do I need to add it to the function.php?

    Thank you in advance

    #15308
    Tom
    Keymaster

    Code Snippets should work. Is the video displaying at all?

    #15322
    Reagan
    Participant

    Nope. I thought maybe the elementor plugin was causing a disruption so I deactivated that and I have classic text editor installed. Still no video. The video appears and plays fine on the actual blog post, but WP Show Post is text only. The videos are on my server these aren’t links to YouTube or Vimeo. Trying a video thumbnail generator plugin but not having much luck. Any thoughts?

    #15348
    Tom
    Keymaster

    So this is the function you’re using?:

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

    Have you updated the post meta name to the name of your custom field?

    If you do the following, does anything display?:

    add_action( 'wpsp_before_header', function() {
        $video = get_post_meta( get_the_ID(), 'your_field_name', true );
    
        var_dump( $video );
    
        if ( $video ) {
            echo $video;
        }
    } );
Viewing 5 posts - 16 through 20 (of 20 total)
  • You must be logged in to reply to this topic.