Is this possible? I've never seen it used, but I need it... I want to show for each author (if they are logged in) on their own profile page, the amount of comments they have posted today. If the day passes by, than the counter has to be 0 and the comment counter has to start again.
You can try this query that counts user comments by using the
where we use PHP to give the current date and we don't use any SQL date functions on each row.
You could also consider using the WP_Comment_Query class if you are looking for a more native solution.
You can use it like this for the current logged in user:
and for the current author:
in the loop in the template page
Outside the loop in
for the current author.
|show 1 more comment|
Yes it's definitely possible. Refer to http://codex.wordpress.org/Function_Reference/get_comment, you'll need to get the current server time in UNIX format and then convert
I don't know of a way to directly pull this query with Core functions, but the SQL is simple.
You can alternately use something like