Title: video short code
Last modified: September 1, 2017

---

# video short code

 *  [vl4d](https://wordpress.org/support/users/vl4d/)
 * (@vl4d)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/video-short-code/)
 * 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, 9 months ago by [vl4d](https://wordpress.org/support/users/vl4d/).
    -  This topic was modified 8 years, 9 months ago by [vl4d](https://wordpress.org/support/users/vl4d/).
    -  This topic was modified 8 years, 9 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress

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

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/video-short-code/#post-9459536)
 * 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](https://wordpress.org/support/users/vl4d/)
 * (@vl4d)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/video-short-code/#post-9460149)
 * 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](https://wordpress.org/support/users/vl4d/)
 * (@vl4d)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/video-short-code/#post-9464463)
 * nothing?? :/ (sorry for double reply :/ )
 *  Thread Starter [vl4d](https://wordpress.org/support/users/vl4d/)
 * (@vl4d)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/video-short-code/#post-9477817)
 * 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [vl4d](https://wordpress.org/support/users/vl4d/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/video-short-code/#post-9477817)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
