Custom Archive from non-WP Database
-
Hi, when I first created my reading blog using WP, custom fields were not very common, so I created fields for the ratings in a table in my database. I can access my posts in single.php and make a custom query to show the rating from the table using this code:
$results = get_review($post->ID); if (mysql_num_rows($results) > 0) { $fields = mysql_fetch_row($results); $rating = $fields[1]; }In single.php I already have the ID of the post, so it’s easy to retrieve the fields I need and it’s working fine. But now I would like to create an Archive page where I could sort my posts by ratings. For example: all posts with a rating of ‘5’ or ‘3’. I can’t use the archive.php from WP and if I create a custom query, then the WP pagination will be broken…
I’ve searched on Google and the WP Forums with no success, and I’m stuck so I hope someone will be able to help me. I’m not a coder so maybe it seems easy to do but I couldn’t find a way to do it so far… Thank you for you help! 🙂
The topic ‘Custom Archive from non-WP Database’ is closed to new replies.