WP hacks; customize output with query_posts
-
Howdy.
I am attempting to use WordPress for a digg-style website where users rank videos.
I have added the variable “zaprank” to the wp_posts table; this is a 1-10 used to rank each video, held as FLOAT.
I can easily access my var with $post->zaprank, so I know it is in there and working properly.
On my home page, I want to ORDER BY zaprank DESC, so that the top-rated stuff is on top, just like digg, reddit, etc.
Here are my results:
https://zaphodforpresident.com/projectx/
Here is my code:
<?php $posts = query_posts($query_string.’&orderby=zapscore&orderby=DESC’); ?>
In MySQL I want this:
SELECT * FROM wp_posts WHERE 1 ORDER BY zapscore DESC
I also want to include any pagination (i.e. LIMIT 10, 1)
Any thoughts?
- The topic ‘WP hacks; customize output with query_posts’ is closed to new replies.