php - Wordpress Functionality Plugin
319
I am trying to write a Wordpress functionality plugin but I am stuck in how to proceed. This is an HTML5 video plugin and I want to integrate it into any Wordpress post/page. This is what I did so far:
<?php
/*
Plugin Name: plugin
Description: A Video gallery with thumbnails showing trailers
Version: 1.0
License: testing plugin
Author: Testing Users
Author URI: http://www.test.com
*/
$html = <<<HTML
<script type="text/javascript" src="html5gallery==/html5gallery.js"></script>
<div data-skin="gallery" data-width="680" data-height="375">
<!-- Add Vimeo video to Gallery -->
<a href="link"><img src="link2" alt="name"></a>
<a href="link"><img src="link2" alt="name"></a>
<a href="link"><img src="link2" alt="name"></a>
<a href="link"><img src="link2" alt="name"></a>
<a href="link"><img src="link2" alt="name"></a>
<a href="link"><img src="link2" alt="name"></a>
<a href="link"><img src="link2" alt="name"></a>
<a href="link"><img src="link2" alt="name"></a>
</div>
HTML;
function video_gallery() {
echo $html;
}
add_shortcode('wordpress_video_gallery', 'video_gallery');
?>
I installed the plugin but when I add the Shortcode on a page/post nothing is appearing.
Answer
Solution:
Here some code for wordpress shortcode.
Now if you add [wordpress_video_gallery] into your page or post you can view the output which you set into the video_gallery method in this page or post.