• hello ๐Ÿ™‚ i want little help to make a short code for my videos..

    how to make this?? [videoplayer id=”gdrive” link=”videolink.mp4″]

    function video_func() {
        $gdrive = "<iframe src="here i don't know how to do" width="640" height="480" frameborder="0" allowfullscreen></iframe>";
    }
    add_shortcode( 'videoplayer', 'video_func' ); 
    • This topic was modified 8 years, 7 months ago by vl4d.
    • This topic was modified 8 years, 7 months ago by vl4d.
    • This topic was modified 8 years, 7 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress
Viewing 4 replies - 1 through 4 (of 4 total)
  • The basic function would be something like this…

    function video_func() {
        $gdrive = "<iframe src="http://video-source.com/page" width="640" height="480" frameborder="0" allowfullscreen></iframe>";
    
        return $gdrive;
    }
    add_shortcode( 'videoplayer', 'video_func' );

    As to what URL to use for the iFrame that you’re setitng up, that’s almost impossible to tell without knowing at least what video hosting platform you’re using. Most of the big ones (YouTube, Vimeo, etc) have good embed codes available for their videos, and a lot can be automatically embedded in yor page by just pasteing the URL into it.

    Thread Starter vl4d

    (@vl4d)

    is not youtube is custom link hosted by me, just i want this code with link=โ€videolink.mp4โ€ณ] how to make to work the X link from shortcode??

    Thread Starter vl4d

    (@vl4d)

    nothing?? :/ (sorry for double reply :/ )

    Thread Starter vl4d

    (@vl4d)

    soo i make the script but is not show nothing (the code is show up in view source but in front nothing)

    function video_player( $atts ) {
        extract( shortcode_atts( array (
            'id' => ''
        ), $atts ) );
        return '<iframe src="https://drive.google.com/file/' . $id . '/view" height="240" width="320" allowfullscreen="" frameborder="0"></iframe>';
    }
    add_shortcode ('player', 'video_player' );

    [player id=”d/0Bx3KA2iVjV3LajNFalVoN1lfRHM”]

    what is wrong???

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘video short code’ is closed to new replies.