Hallo Richard,
Still playing arround with some code! For now i have pagination working for custom pages… Maybe you can extend on the following code! I don’t have the search function working as of yet!
Here is the code!
<?php get_header();
/**
* Template Name: listing
**/
?>
<?php
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
$custom_args = array(
'post_type' => 'wpcm_vehicle',
'posts_per_page' => 2,
'paged' => $paged
);
$custom_query = new WP_Query( $custom_args ); ?>
<?php if ( $custom_query->have_posts() ) : ?>
<!-- the loop -->
<?php while ( $custom_query->have_posts() ) : $custom_query->the_post(); ?>
<article class="loop">
<?php echo get_the_post_thumbnail( $page->ID, 'thumbnail' ); ?>
<a href="<?php the_permalink() ?>"><h3><?php the_title(); ?></h3></a>
<li class="wpcm-price"><?php $price = get_post_meta($post->ID, 'wpcm_price', true); ?> <?php echo $price; ?></li>
<li><?php $mileage = get_post_meta($post->ID, 'wpcm_mileage', true); ?> <?php echo $mileage; ?></li>
<li><?php $frdate = get_post_meta($post->ID, 'wpcm_frdate', true); ?> <?php echo $frdate; ?></li>
<li><?php $engine = get_post_meta($post->ID, 'wpcm_engine', true); ?> <?php echo $engine; ?></li>
<div class="content">
<?php the_excerpt(); ?>
</div>
</article>
<?php endwhile; ?>
<!-- end of the loop -->
<!-- pagination here -->
<?php
if (function_exists(custom_pagination)) {
custom_pagination($custom_query->max_num_pages,"",$paged);
}
?>
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
<?php get_footer(); ?>
Offcourse you need to style the elements to match your website.
U can use this for the time being! Now lets wait for a plugin update where pagination is fully working ??
Patrick