V
V
Viorel2018-03-05 13:30:38
WordPress
Viorel, 2018-03-05 13:30:38

Custom post type ajax pagination how to do?

Created a custom post type how to add pagination to this code give me an idea

<section class="post-personaj">
  <div class="grid-container">
    <div class="grid-x grid-padding-x post-list">
    
<?php 
$args = array( 

'post_type' => 'personaj', 'posts_per_page' => 3
);

$loop = new WP_Query( $args );?>
<?php 
while ( $loop->have_posts() ) : $loop->the_post();?>
<div class="cell medium-4 small-12 list-item">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  <div class="container">
 <?php entertainment_post_thumbnail(); ?>
<div class="overlay-item">
<div class="text"><?php the_content(); ?></div>
</div>
 </div>
 <h3><?php the_title(); ?></h3>
</article>
 </div>
<?php 

endwhile;?>

<?php 
  wp_reset_postdata();
?>  
<div class="loadmore">Load More...</div>

</div>
</div>
 </section>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2018-03-05
@bushido2014

If you need a simple and quick option without code, then the plugin:
https://ru.wordpress.org/plugins/malinky-ajax-pagi...
And if with code, then
https://gabrieleromanato.name/wordpress-ajax -pagin...
https://premium.wpmudev.org/blog/load-posts-ajax/ I
implemented ajax pagination on my site (although this is alphabetic pagination, glossary)
https://md7.info/preparaty
code if needed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question