Created
April 23, 2020 16:49
-
-
Save wpjess/c5550778e001f1e9a176b1bd95ef967c to your computer and use it in GitHub Desktop.
Loop by post type
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 $paged=(get_query_var('paged')) ? get_query_var('paged') : 1; query_posts(array('post_type'=>'slides', 'showposts'=>-1, 'posts_per_page' => 1, 'paged' => $paged )); ?> | |
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> | |
<?php | |
$image = get_post_meta($post->ID, 'slide_image', true); | |
?> | |
<div class="item"><img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" title="" /></div> | |
<?php endwhile; endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment