我正在尝试找到一种方法来使用上一个和下一个按钮来为给定的查询排序显示更多数据,就像分页一样。
查询是这样的:
$query = "SELECT *
FROM wp_posts p
LEFT OUTER JOIN wp_term_relationships r ON r.object_id = p.ID
LEFT OUTER JOIN wp_term_taxonomy x ON x.term_taxonomy_id = r.term_taxonomy_id
LEFT OUTER JOIN wp_terms t ON t.term_id = x.term_id
LEFT JOIN wp_postmeta pm ON p.id = pm.post_id
WHERE p.post_status = 'publish'
AND pm.meta_key = 'xTraData'
AND p.post_type = 'post'
AND t.slug = 'press-coverage'
ORDER BY p.post_date DESC LIMIT 0,6;";
如何获取上一个 id和下一个 id用于下一个/上一个按钮以刷新查询字符串?