Pagination to a Custom Select Query
-
i am using the custom select query to get the particular posts
$query = “
SELECT *
FROM $wpdb->posts
WHERE $wpdb->posts.post_country = ‘”.$usercounty.”‘
AND $wpdb->posts.post_type = ‘post’
ORDER BY $wpdb->posts.ID DESC LIMIT “.$paged.”,20″;
$pageposts =$wpdb->get_results($query);
if ($pageposts):
global $post;
foreach ($pageposts as $post):
setup_postdata($post);
//loop here
endforeach; endif;
i want to display 20 post in each page
please help me
- The topic ‘Pagination to a Custom Select Query’ is closed to new replies.