// =============================== Video Player widget ======================================
function videoWidget()
{
$number = 5;
$settings = get_option("widget_videowidget");
if ($settings['number']) $number = $settings['number'];
?>
<div id="video" class="block wrap">
<h2 class="widget_title">Latest Videos</h2>
<div class="fix"></div>
<?php query_posts('showposts='.$number.'&category_name='.get_option('woo_video_category')); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div id="video-<?php the_ID(); ?>" class="latest">
<?php the_content('[...]'); ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php query_posts('showposts='.$number.'&category_name='.get_option('woo_video_category')); ?>
<?php if (have_posts()) : ?>
<div class="vidtabs">
<ul id="idTabs" class="wrap tabs">
<?php while (have_posts()) : the_post(); $count++; ?>
<li><a href="#video-<?php the_ID(); ?>" title="<?php the_title(); ?>"><?php echo $count; ?></a></li>
<?php endwhile; ?>
</ul>
</div>
<?php endif; ?>
</div>
<?php
}
register_sidebar_widget('Woo - Video Player', 'videoWidget');
function videoWidgetAdmin() {
$settings = get_option("widget_videowidget");
// check if anything's been sent
if (isset($_POST['update_video'])) {
$settings['number'] = strip_tags(stripslashes($_POST['video_number']));
update_option("widget_videowidget",$settings);
}
echo '<p>
<label for="video_number">Number of videos (default = 5):
<input id="video_number" name="video_number" type="text" class="widefat" value="'.$settings['number'].'" /></label></p>';
echo '<label>NOTE: Setup the video category in the theme Options Panel';
echo '<input type="hidden" id="update_video" name="update_video" value="1" />';
}
register_widget_control('Woo - Video Player', 'videoWidgetAdmin', 200, 200);
?>
<!-- TABS STARTS -->
<?php if (!get_option('woo_tabs')) { ?>
<div id="tabs" class="block">
<ul id="idTabs" class="wrap tabs">
<li><a href="#pop">Popular</a></li>
<li><a href="#comm">Comments</a></li>
<li><a href="#tagcloud">Tags</a></li>
</ul>
<div class="inside">
<ul id="pop">
<?php include(TEMPLATEPATH . '/includes/popular.php' ); ?>
</ul>
<ul id="comm">
<?php include(TEMPLATEPATH . '/includes/comments.php' ); ?>
</ul>
<div id="tagcloud">
<?php wp_tag_cloud('smallest=12&largest=20'); ?>
</div>
</div>
</div>
<?php } ?>
<!-- TABS ENDS -->
1. Grab a video embed code from a video site like YouTube or Vimeo
2. Go to Write > Post and paste the code into your post by using the HTML view in your editor, along with any other content you wish to have in the post.
3. Paste the embed code into the Excerpt field if you want the video to appear in the sidebar video player. If you don’t do this, the video will not show in the video player (see screenshot below).
4. Change the video size in the embed code in the Excerpt to width=”250″ and height=”180″ so it will fit in the sidebar.
5. Publish your video
Registrerte brukere: Ingen registrerte brukere