Help with The Loop and replacement query
I run a private site with a limited number of users. Each post has a rating feature (via plug-in) attached to it, and I’m trying to create a plug-in (or link, something) to let them display all the posts that they have not yet rated.
In MySQL, I know exactly what my query has to look like:
SELECT post.post_title,post.id FROM wp_posts
LEFT JOIN rating_table AS votes ON post.ID=votes.id AND votes.user_ID=1 WHERE votes.id IS NULL;
The user ID bit would be variable, of course, for each logged in user. This query works fine as raw SQL for finding those posts that a given user hasn’t yet rated.
However, where my complete lack of experience shows is in how to translate the above into a replacement query to build The Loop’s selection of posts.
Any and all pointers appreciated; I’ve done tons of googling, but my head just winds up spinning (I’m not a coder by trade, but can usually muddle my way through the basic stuff).
- The topic ‘Help with The Loop and replacement query’ is closed to new replies.