Hello I have created a custom php file that I use to show specific posts by value inside the a custom field. So for example I have 100 posts, let's say they all have custom field MyTitle and 10 of them have value "New".
$querystr = "
SELECT $wpdb->posts.*
FROM $wpdb->posts, $wpdb->postmeta
WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id
AND $wpdb->postmeta.meta_key = 'Mytitle'
AND $wpdb->postmeta.meta_value LIKE '%".$mytitle."%'
AND $wpdb->posts.post_status = 'publish'
AND $wpdb->posts.post_type = 'post'
AND $wpdb->posts.post_date < NOW()
ORDER BY $wpdb->posts.post_date DESC
";
$pageposts = $wpdb->get_results($querystr, OBJECT);
So I use the code to display those posts, however I wanted to add a pagination.I've done some search here and on the internet, but all the pagination is rather different talking about getting "paged" from the main query.. I don't really understand that part. So can you show me examples which I can use with the code that I've shown here?