Skip to content

Instantly share code, notes, and snippets.

@masumskaib396
Last active November 25, 2018 08:47
Show Gist options
  • Save masumskaib396/cd2abda81470f172782115e55191d948 to your computer and use it in GitHub Desktop.
Save masumskaib396/cd2abda81470f172782115e55191d948 to your computer and use it in GitHub Desktop.
<?php
$paged = get_query_var('paged')? get_query_var('paged') : 1;
$acf_rel_id = get_field('relatied_post');
$post_par_page = 3;
$acf_rp = new WP_Query( array(
'post__in' => $acf_rel_id,
'orderby' => 'post__in',
'posts_per_page' => $post_par_page,
'paged' => $paged,
) );
while ($acf_rp->have_posts()) {
$acf_rp->the_post();
?>
<!-- content -->
<h1></h1>
<p></p>
<img src="" alt="">
<?php
}
wp_reset_query()
?>
<!-- paginate links -->
<?php
echo paginate_links( array(
'total' => $acf_rp->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