In your author.php, try something like this:
<?php
c2c_get_recent_posts (5, "<li>%post_date%: %post_URL%</li>", '', 'date', 'DESC', 0, 'm/d/Y', '$author', false)
?>
If that doesn’t work, try this, to get the author ID:
$author_ID = $wpdb->get_var ("SELECT ID FROM $wpdb->users WHERE user_name = '$author'");
where should i add the:
$author_ID = $wpdb->get_var (“SELECT ID FROM $wpdb->users WHERE user_name = ‘$author'”);
to?
Immediately above the call to the c2c_get_recent_posts() function in your author.php. Then adjust the call to c2c_get_recent_posts() to use $author_ID instead of $author.
it gives me this error:
WordPress database error: [Unknown column ‘user_name’ in ‘where clause’]
SELECT ID FROM electronics_users WHERE user_name = ‘1’
Sorry, try user_nickname instead.
nope…still the same. *sigh*.
electronics.briefme.com is the site i’m testing it on right now.
http://electronics.briefme.com/archives/author/administrator/
What’s the problem?
EDIT: never mind. I see that all authors’ pages are showing the same list of posts.
thank you very much by the way for your time.
if i manually enter the author ID, everything is fine. so logically, shouldn’t it work also if i set author_ID as an integer variable? i can’t, for the life of me, figure out why it won’t work.
$author_ID = $wpdb->get_var ("SELECT ID FROM $wpdb->users WHERE user_nickname = '$author'");
echo c2c_get_recent_posts (5, "<li>%post_date%: %post_URL%</li>",
'', 'date', 'DESC', 0, 'm/d/Y', $author_ID, false);
That worked on my test blog. If you’re not using “nickname” in Options -> Profile to display your author name(s), you’ll need to adjust the first line.
Note the lack of quotes around $author_ID. No quotes and double-quotes would work, but the single quotes as I used in my original suggestion will not work.
…still not working.
what’s the URL for your site? i would like to check it out in action.
or rather, is there any other way to extract the author ID into a variable?
still nothing works. tried it on a different domain, but the same happens. i practically copy-pasted it exactly.