Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active February 1, 2018 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/404e67453bb5610c588cc12d846cc738 to your computer and use it in GitHub Desktop.
Save billerickson/404e67453bb5610c588cc12d846cc738 to your computer and use it in GitHub Desktop.
<?php
/**
* YouTube Gallery
*
* @package CoreFunctionality
* @author Bill Erickson
* @since 1.0.0
* @license GPL-2.0+
**/
/**
* Youtube Gallery
*/
function ea_youtube_gallery_shortcode() {
$output = '<div class="youtube-gallery">';
// Video Player
$output .= '<div class="youtube-gallery--player">';
$output .= '<h4>Video goes here</h4>';
$output .= '</div>';
// Video Listing
$output .= '<div class="youtube-gallery--listing">';
for( $i = 0; $i < 24; $i++ ) {
$class = 0 == $i ? 'item active' : 'item';
$output .= '<a href="#main-content" class="' . $class . '">';
$output .= '<span class="title">thumbnail goes here</span>';
$output .= '</a>';
}
$output .= '</div>';
$output .= '</div>';
return $output;
}
add_shortcode( 'ea_youtube_gallery', 'ea_youtube_gallery_shortcode' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment