Skip to content

Instantly share code, notes, and snippets.

@masumskaib396
Last active November 20, 2018 06:02
Show Gist options
  • Save masumskaib396/9786255eee8449bf88ecd7eb6fc23116 to your computer and use it in GitHub Desktop.
Save masumskaib396/9786255eee8449bf88ecd7eb6fc23116 to your computer and use it in GitHub Desktop.
<?php
$post_in = array(101,98,1);
$paged = get_query_var('paged')? get_query_var('paged') : 1;
$post_par_page = 1;
$_p = new WP_Query( array(
'post__in' => $post_in,
'orderby' => 'post__in',
'post_type'=> 'post',
'posts_per_page' => $post_par_page,
'paged' => $paged,
) );
while ($_p->have_posts()) {
$_p->the_post();
?>
<!-- content -->
<h2></h2>
<p></p>
<img src="" alt="">
<?php
}
wp_reset_query()
?>
<!-- paginate links -->
<?php
echo paginate_links( array(
'total' => $_p->max_num_pages,
'current' => $paged,
'prev_next' => false,
) )
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment