12-06-2007, 01:30 PM
|
#20 (permalink)
|
|
The Contributor
Join Date: Oct 2007
Location: Argentina
Posts: 72
Thanks: 18
|
I didn't test this but seems your problem is on the query. Try this out:
PHP Code:
$last_posts = (array)$wpdb->get_results(sprintf("
SELECT {$tp}terms.name, {$tp}terms.term_id
FROM {$tp}terms, {$tp}term_taxonomy
WHERE {$tp}terms.term_id = '%d'
AND {$tp}term_taxonomy.taxonomy = category
{$hide_check}
",$number));
And call you function this way:
PHP Code:
echo posts_by_category(4);
|
|
|
|