views:

180

answers:

0

Hi!

I am really struggeling with this problem..

I want to have a slideshow of my featured post via cycle in my wordpress index.php, but well.. wordpress wont.

First I enqueued cycle and my script in the header:

<?php
   wp_enqueue_script('jquery.cycle.all.min', '/wp-content/themes/black1/js/jquery.cycle.all.min.js', array('jquery'));
   wp_enqueue_script('jquery_script', '/wp-content/themes/black1/js/jquery_script.js');
?>

This is my jQuery script:

$(document).ready(function(){  
$('#slideshow').cycle({ 
    fx: 'fade' 
});
});

Then I put this code in the index.php of my template to show the 5 recent post in the featured category:

<div id="slideshow">
<?php query_posts('cat=88&showposts=5'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="slideshow_post">
 <div class="slideshow_overlay">
  <h2 class="topTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
  <p class="byline"><?php echo get_post_meta($post->ID, 'beschreibung', true); ?></p>
 </div>
 <a class="slideshow_pic" href="<?php the_permalink() ?>"><img src="images/testbild.jpg" alt="test"/></a>
</div>
<?php endwhile;?>

It looks pretty neat with the overlay and stuff, but it doesn't animate at all - just puts 5 posts one below the other.

And here is my CSS:

#slideshow {
  width: 700px;
  height: 400px;
  background: #ccc;
  margin: 0 0 20px 0;
  border: 1px solid #ddd;
  }
.slideshow_post{
  width: 640px;
  height: 360px;
  background: #777;
  padding: 2px;
  position: relative;
  }
.slideshow_overlay {
  width: 640px;
  height: 100px;
  position: absolute;
  background: url(images/overflow.png) repeat;
  clear: none;
  bottom: 0;
  }
a.slideshow_pic{
  width: 640px;
  height: 360px;
  overflow: hidden;
  padding: 0;
  }

What really sets me up, is the fact that this animation with the css and stuff all worked in a new html page. ???

What am I doing wrong?

Greets from Germany KAiN