Support » Fixing WordPress » Mini Loop: exclude category

  • I am using the mini code on a static page and so far it shows all the categorys.
    I would like it to shwo only one specific category (news)
    Help would be much appriciated.

    the mini loop:
    $how_many=5; //How many posts do you want to show
    require_once("../core/wp-config.php"); // Change this for your path to wp-config.php file ?>
    <ol id="whats-new">
    ID,post_title FROM $wpdb->posts
    post_status= "publish" ORDER BY 'ID' DESC LIMIT ".$how_many);
    foreach($news as $np){
    print ("*<a href="");
    echo get_permalink($np->ID);
    print ("">$np->post_title</a><br>");
    } ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Mini Loop: exclude category’ is closed to new replies.