50 reputation
12
bio website
location
age
visits member for 1 year, 9 months
seen 3 hours ago

3h
comment using update_user_meta to rank users
SQL query breaks the page unfortunately.
6h
comment using update_user_meta to rank users
Can you slip the SQL statement into an example loop? Just as a FYI, the first method is doing strange things. Whenever I refresh the page (see the edit at the bottom, that's the loop I'm using to output the ranked users) it adds one or two points to each user. Strange, right?
8h
comment using update_user_meta to rank users
Sure thing! thanks.
18h
comment using update_user_meta to rank users
Ok after some testing I can say this sort of works. The problem is that every time a post is voted on it increments the epicredvote meta field of that user by 1, so a post can be voted up/down/up/down/up/down/ and that users meta value will increase by 8. Obviously it should be the sum of the votes and not how many times the users posts have been voted on.
18h
comment using update_user_meta to rank users
Doing some testing now. Will report back soon.
1d
comment using update_user_meta to rank users
No filters that I can see. It does use Ajax however to register the votes. Made a small edit to the first code block (at the top). I'm sure it's possible to update the user meta with ajax when someone votes on the post, the problem is 1. update_user_meta is a WP function I've never worked with before and 2. Ajax is finicky as heck when I try to get it to work with WP.
Jun
13
comment Sort users by meta_value_num
Reading about update_user_meta just now. Trying to get my head around the logic for this. So it's creating a new row in the database (sorry, not particularly knowledgeable about DB's and their structures etc), will it automatically know the meta_key count for each user?
Jun
13
comment Sort users by meta_value_num
Alright well, I'm silly. Although I can get the total number of 'points' each user has recieved on their author.php page, apparently it's not a user meta key. Urgh. Still possible to query users based on the number of votes they've received on their posts or will I need to learn how to create a user some sort of table/meta key or whatever?
Jun
13
comment Sort users by meta_value_num
Ok I can query by first_name. I dumped my database and I'm checking for epicredvote as a key now. Will report back.
Jun
13
comment Sort users by meta_value_num
Well by virtue of the fact I can get the number value on author.php, the meta key definitely exists for users. See my edit from yesterday.
Jun
12
comment Where to add the_post_thumbnail( )
your code doesn't look complete in your question. There's no closing statements.
Jun
12
comment Where to add the_post_thumbnail( )
Just place it anywhere after <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> You'll have to figure out where you want to place it within the html and tweak the css now! Click accept i my answer helped you. :)
Jun
12
comment Sort users by meta_value_num
I edited my original question, hope that's clear enough.
Jun
12
comment Sort users by meta_value_num
Taking a look now, will update soon, thanks.
Jun
12
comment Sort users by meta_value_num
3.9, the latest version
Jun
12
comment Sort users by meta_value_num
Yeah, still no output using firstname as the meta_key, edited my question to reflect.
Jun
12
comment Sort users by meta_value_num
Latest version of wordpress.
Jun
12
comment Sort users by meta_value_num
Still getting 'no users found'. If I write it as I did (meta_value_num) it returns users, just in alphabetical order. If I do it your way (pre_user_query) and with meta_value it just returns 'no users found'.
Jun
12
comment Sort users by meta_value_num
'no users found'. Wonder if it's possible to get users with wp_query
May
10
comment Pagination working locally but not on live site
because pre_get_posts doesn't work on single.php