Wordpress Functionality Plugin

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 style="display:none;" class="html5gallery" 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.

Solutions

Here some code for wordpress shortcode.

/*
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
*/

function video_gallery() {
// All your html and js code place here.
}

 add_shortcode('wordpress_video_gallery', 'video_gallery');

?>

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.

Tags: PHP / Wordpress

Similar questions

Wordpress use table sort functionality in own plugin
I'm creating a own plugin for wordpress where I have to view a set of data. Now I want to use the wordpress default table view to display my data, and give some functionality to it. default table: Is there a way to use this table view for my own plugins (some classes or functions) or do I have to create something similar by myself?
Replacing WordPress core functionality with a plugin
I'm creating a WordPress plugin for a custom menu layout. I am well aware that I could just as easily implement this menu directly into the theme and I've read up quite thoroughly on the features and limitations of wp_nav_menu(), plus I have already tried and tested every plugin already created for replacing the default WordPress menu. I wish to us...
Wordpress Functionality: Custom Theme or Plugin?
I am new to Wordpress (using roughly 6 months) and just now getting into development when I decided I would attempt to replicate a project I have going currently and after reading multiple blogs regarding plugin development and custom post types, I am thoroughly confused as to which direction I should go. I am in need of creating a site that has ba...
Adding functionality to a wordpress plugin
This is a simple concept question... If I have a wordpress plugin and I want to write some functions for my own IN ADDITION to what they have already where would I put them in the wordpress file structure? I cant put them in the original core.php files/directory because they will get wiped out when the plugins are updated right? @NomikOS - Yeah Sur...
Wordpress Plugin Functionality on Static Site
Is there some way to implement the functionality of a Wordpress plugin on a static site? For example, if I have a static html site at http://mystaticsiteatroot.com and have a Wordpress installation in a subdirectory such as http://mystaticsiteatroot.com/wordpblog, could I then somehow call one of the functions or returns of a Wordpress plugin by pl...
Does WordPress provide plugin override functionality the way Joomla does?
I would like to override the output for a WordPress plugin in a similar manner as I would for Joomla, is this possible?

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.