Skip to content

Instantly share code, notes, and snippets.

@mxmader
Created May 18, 2017 15:30
Show Gist options
  • Save mxmader/d24dc1216a0d6b55b402a2241e30f23f to your computer and use it in GitHub Desktop.
Save mxmader/d24dc1216a0d6b55b402a2241e30f23f to your computer and use it in GitHub Desktop.
WP Plugin with shortcode example
<?php
/*
* Plugin Name: Pro Soccer Kids Video Player
* Description: Displays static HTML so that TinyMCE can't corrupt our video player code
* Version: 1.0
* Author: [email protected]
* Author URI: http://jmader.com
*/
function psk_homepage_video(){
return '
<div class="alignleft home-video-box">
<div class="home-video-overlay">
<a href="//www.youtube.com/watch?v=xWgkhL6vc2U" rel="prettyPhoto"></a>
</div>
<div>
<img class="home-video-image"
alt="Pro Soccer Kids Introduction Video"
src="//pskdev.maderj.com/wp-content/uploads/2013/08/20150412_113007-300x169.jpg" />
</div>
</div>
';
}
add_shortcode('psk_homepage_video', 'psk_homepage_video');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment