Created
October 13, 2015 18:58
-
-
Save dryan1144/1846c18994c46e5911a2 to your computer and use it in GitHub Desktop.
This file contains 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 //Slides loop | |
$args=array( | |
'post_type' => 'slide', //this is your cpt name | |
'post_status' => 'publish', | |
'posts_per_page' => -1, //this is the max number of slides | |
'orderby' => 'menu_order', | |
'order' => 'ASC' | |
); | |
$slide_query = new WP_Query($args); | |
if ($slide_query->have_posts()) : | |
echo '<ul class="slides">'; | |
while ($slide_query->have_posts()) : $slide_query->the_post(); | |
echo '<li>'; | |
//this is where you add the image, your titles, other custom fields, etc | |
echo '</li>'; | |
endwhile; | |
echo '</ul>'; | |
endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment