Last active
October 7, 2015 05:07
-
-
Save jasperf/3109949 to your computer and use it in GitHub Desktop.
Nivo Slider in WordPress met WP_Query #wordpress #slider #wp-query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="slider-wrapper"> | |
<div class="slider-wrapper theme-default"> | |
<div class="ribbon"></div> | |
<div id="slider" class="nivoSlider"> | |
<?php $pj_slider = new WP_Query('post_type=img_slideshow&showposts=4'); while($pj_slider->have_posts()) : $pj_slider->the_post(); ?> | |
<?php $pj_slider_caption = '#slider-caption-'.get_the_ID(); ?> | |
<?php if(has_post_thumbnail() ) { ?> | |
<?php the_post_thumbnail('slider', array('title' => ''.$pj_slider_caption.'')); ?> | |
<?php } ?> | |
<?php endwhile; wp_reset_query(); ?> | |
</div> | |
<?php $pj_slider_caption = new WP_Query('post_type=img_slideshow&showposts=4'); | |
while($pj_slider_caption->have_posts()) : $pj_slider_caption->the_post(); ?> | |
<div id="slider-caption-<?php the_ID(); ?>" class="nivo-html-caption"> | |
<span class="nivo-caption-title"><?php the_title(); ?></span> | |
<?php $pj_nivo_caption_content = get_the_excerpt(); ?> | |
<span class="nivo-caption-content"><?php echo $pj_nivo_caption_content; ?></span> | |
<span class="nivo-caption-link"><a href="<?php the_permalink(); ?>">Read more about this feature »</a></span> | |
</div><!-- // nivo-html-caption --> | |
<?php endwhile; wp_reset_query(); ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment