Hello,
I have a WP site (currently running v2.3.2, but about to go to v2.5.1). My home page is a static page that has a small amount of code that shows the last 3 posts from my blog (using a very custom version of Brian Gardner's Silhouette theme).
The code I use is:
- - - - - - - - -
<!-- Mini Loop from Blog -->
<h1>Latest From The Blog...</h1>
<?php
$how_many=3; //How many posts do you want to show
require_once('./blog/[login to view URL]'); // Change this for your path to [login to view URL] file ?>
<ul id="whats-new">
<?
$news=$wpdb->get_results("SELECT `ID`,`post_title`,`post_excerpt` FROM $wpdb->posts
WHERE `post_type`=\"post\" AND `post_status`=\"publish\" ORDER BY post_date DESC LIMIT $how_many");
foreach($news as $np){
$permalink=get_permalink($np->ID);
$html= "<li><a href=\"". $permalink . "\">$np->post_title</a><br/ >
$np->post_excerpt <br /> &nbsp; <a href=\"" . $permalink . "\">&raquo; Read the full post</a></li><br/ >\n";
//NOTE: you can easily alter the HTML above to suit
echo $html;
} ?>
</ul>
- - - - - - - - -
However, I understand that will have to change for v2.5.1 anyway.
But that includes posts from ALL categories, and I want to EXCLUDE a specific category (category ID 11, which is my Twitter Tools category).
Basically I don't want the Twitter auto posts to appear in the loop on my home page.
I don't know enough about the v2.5 coding to exclude a category from a simple loop.
The loop contains, for each of the posts,
Title (links to full post), excerpt and a "read more" link to the full post.
I also want to be able to specify how many posts are included in the loop. Currently I have 3, but may later change to more posts.
The final code MUST be v2.5.1 compatible -- doesn't have to be compatible with 2.3.2, as the site will be upgraded when the new loop code is installed into the theme page template.
Once the code is completed, the full rights to use it as I see fit will then be transferred to me (although the winning bidder can also use the code themselves).