I managed to set up a query carousel slider on my test-site. How can i adapt the slider to show the 5 latest posts from my featured post category with thumb, title and link to the post instead of the manuel written html parts?
I already find a code to show up the featured posts with following code - but i dont know how to implement the below code (or any other code) into the carousel slider (see fiddle above) to show each featured post in each box... :(
<ul class="test">
<?php
$default_thumbnail = 'http://.....d-slider.png';
$the_query = new WP_Query('showposts=5&orderby=desc&category_name=featured');
while ($the_query->have_posts()) : $the_query->the_post(); ?>
<li>
<a target="_blank" href="<?php the_permalink()?>" title="<?php the_title_attribute(); ?>">
<?php
if (has_post_thumbnail()):
the_post_thumbnail('default-thumbnail');
else:
?>
<img src="<?php echo $default_thumbnail; ?>" alt="<?php the_title(); ?>" />
<?php endif; ?>
<h2><?php the_title(); ?></h2></a>
</li>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</ul>
wp_reset_query
should only be used withquery_posts
, you should usewp_reset_postdata
instead