Created
April 30, 2013 00:02
-
-
Save FernE97/5485753 to your computer and use it in GitHub Desktop.
PHP: WordPress Slides v2
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
<?php | |
$args = array( | |
'post_type' => 'slides', // custom post type | |
'orderby' => 'menu_order', | |
'posts_per_page' => -1 | |
); | |
$slides = new WP_Query( $args ); | |
if ( $slides->have_posts() ) : $count = 0; ?> | |
<ul class="slides"> | |
<?php while ( $slides->have_posts() ) : $slides->the_post(); $count++; ?> | |
<li id="slide-<?php echo $count; ?>" class="slide"> | |
<?php if ( has_post_thumbnail() ) the_post_thumbnail( 'slide' ); // custom thumbnail size ?> | |
<div class="slide-content"> | |
<h2><?php the_title(); ?></h2> | |
<?php the_content(); ?> | |
</div> | |
</li> | |
<?php endwhile; ?> | |
</ul> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment