$paged = (get_query_var(\'page\')) ? get_query_var(\'page\') : 1;
$args= new WP_Query(array(
\'post_type\'=>\'card\',
\'posts_per_page\' => 6,
\'paged\' => $paged,
));
if($args->have_posts()) :
while($args->have_posts()) : $args->the_post();
$permalink=get_the_permalink(get_the_ID());
$title=get_the_title();
echo \'<div class="col-md-4 card-details"><a href="\'.$permalink.\'">\';
echo \'<div class="card-img">\';the_post_thumbnail(\'thumbnail\');echo \'</div>\';
echo \'<div class="card-title"><h4>\'.$title.\'</h4></a>\';
echo\'</div>\';
echo \'</div>\';
endwhile;
$total_pages = $args->max_num_pages;
?>
<div class="greetings-pagination col-md-12">
<?php
if ($total_pages > 1){
$current_page = max(1, get_query_var(\'page\'));
echo paginate_links(array(
\'base\' => get_pagenum_link(1) . \'%_%\',
\'format\' => \'/page/%#%\',
\'current\' => $current_page,
\'total\' => $total_pages,
\'prev_text\' => __(\'prev\'),
\'next_text\' => __(\'next\'),
));
}
?>
</div>
<?php else :?>
<h3><?php _e(\'404 Error: Not Found\', \'\'); ?></h3>
<?php endif; ?>
<?php wp_reset_postdata();?>