Trouble with pagination on custom loop
-
I have searched the forums but havnt found anything to solve my problem.
I am working on a site where i have a custom loop to output posts with a certain meta_key assigned.<?php
$querystr = “
SELECT wposts.*
FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
WHERE wposts.ID = wpostmeta.post_id
AND wpostmeta.meta_key = ‘packageID’AND wposts.post_status = ‘publish’
ORDER BY wposts.post_date DESC
“;$pageposts = $wpdb->get_results($querystr, OBJECT);
?>
<div class=”middleSidebar left”>
<h1>All Listed Properties</h1>
<hr />
<ul id=”homeFeaturedBottom”>
<?php if ($pageposts): ?>
<?php global $post; ?>
<?php foreach ($pageposts as $post): ?>
<?php setup_postdata($post); ?><div class=”post” id=”post-<?php the_ID(); ?>”>
<div class=”append border_r clearfix”>
<div class=”thumbnail-large” style=”margin-right:20px;”> ” title=”<?php the_title(); ?>”>
<img src=”<?php echo $PPT->Image($post->ID,”url”); ?>&w=200″ class=”listImage” alt=”<?php the_title(); ?>” />
</div>
<h3>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”>
<?php the_title(); ?></h3>
<small>Property listed on <?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –></small><h4>The Best Offer to Date is £<?php echo get_post_meta($post->ID, ‘Key_1’, true) ?></h4>
<p class=”postmetadata”>Property Type : <?php the_category(‘, ‘) ?> </p></div>
</div>
<hr />
<?php endforeach; ?>
<?php else : ?>
<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p><?php endif; ?>
What i need is a way to paginate the results so its not just one long list. any help muchly appreciated
- The topic ‘Trouble with pagination on custom loop’ is closed to new replies.