Skip to content

Instantly share code, notes, and snippets.

@dryan1144 dryan1144/slides.php
Created Oct 13, 2015

Embed
What would you like to do?
<?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
You can’t perform that action at this time.