• I’ve got a mini-loop running on the welcome page of my blog:

    <?
    $news=$wpdb->get_results("SELECT
    ID,post_title FROM $wpdb->posts
    WHERE
    post_status= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many);
    foreach($news as $np)
    {
    print ("<li><a href=\"");
    echo get_permalink($np->ID);
    print ("\">$np->post_title</a></li>");
    }
    ?>

    Is it possible to have the titles from 1 certain category displayed? The loop above displays the last 6 posts, but I would like to display the last 6 posts in a certain category …

    I’m thinking AND post_category = something, but! when I look in the WordPress MySQL database, I see that the column for post_category is always zero…

    Anyone an idea on how to have just posts from a certain category displayed?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Mini loop with post titles from 1 category’ is closed to new replies.