/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!-- SLIDER --> <div class="slider main"> <div class="sliderContainer"> <ul class="mainSlider"> <?php $anaHaber = new WP_Query(); $anaHaber->query('post_type=headline&order=ASC&showposts=4'); ?> <?php while ($anaHaber->have_posts()) : $anaHaber->the_post(); ?> <?php 'post_parent' => get_the_ID(), 'post_type' => 'attachment', 'numberposts' => 1, 'order' => 'DESC', 'orderby' => 'date', 'post_mime_type' => 'image')); $i=1; foreach($anaHaberResim as $listele) { $img=wp_get_attachment_image_src($listele->ID, 'mainSlider'); $cap=$listele->post_title; } ?> <li> <a href="<?php the_permalink(); ?>"><img src="<?php echo $img[0]; ?>" alt="<?php echo $cap; ?>"></a> </li> <?php $i++; endwhile; ?> </ul> </div> <ul class="sliderNav"> <?php for($x=1;$x<=$i;$x++) { ?> <li <?php if($x==$i) { echo 'class="noMargin"'; } ?>><a href="javascript:;"><?php echo $x; ?></a></li> <?php }?> </ul> </div> <!-- SLIDER -->