Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Video slider using Custom Fields WordPress

  • SOLVED

I need a jquery slider that will pull 2 - 3 custom fields within 1 post... The custom fields will have video embed codes from sites like vimeo, youtube etc...

Currently using the easySlider 1.7, I would like to keep using it but if I cant I would use something else.
Also have one thing with the easySlider - not able to show both numeric controls and next & previous controls at the same time - if you can help me with that bonus.

You can view the site I am working on here... (the videos are just samples) - http://www.ogradyproductions.com/barcelona/

Here is my current code...

<div class="featureHolder">
<div id="slider">

<ul>
<li class="slider post">
<div class="slider_text hentry">
<?php echo get_post_meta($post->ID, 'video', $single); ?>
</div>
</li>
</ul>

</div><!--END SLIDER ID-->
</div><!--END FEATURE HOLDER-->


I have created a second custom field key called "video2"... how can I put that in there so the slider will go through both...

Answers (2)

2010-04-01

Utkarsh Kukreti answers:

Add all the videos with the custom field 'video' (so that you can have any number of videos on any page)

Then use this code :

<div class="featureHolder">

<div id="slider">

<ul>
<?php foreach(get_post_meta($post->ID, 'video', false) as $video): ?>
<li class="slider post">
<div class="slider_text hentry">
<?php echo $video; ?>
</div>
</li>
<?php endforeach; ?>
</ul>

</div><!--END SLIDER ID-->

</div><!--END FEATURE HOLDER-->

2010-03-31

Buzu B answers:

you need to pull both custom fields using php and then just use jquery to do the slides. Just add another

<li class="slider post">

<div class="slider_text hentry">

<?php echo get_post_meta($post->ID, 'video', $single); ?>

</div>

</li>

but instead of vide use vide2