View Single Post
Old 12-06-2007, 01:30 PM   #20 (permalink)
Matt83
The Contributor
Upcoming Programmer 
 
Matt83's Avatar
 
Join Date: Oct 2007
Location: Argentina
Posts: 72
Thanks: 18
Matt83 is on a distinguished road
Default

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); 
__________________
http://www.mattvarone.com
Matt83 is offline  
Reply With Quote