Exclude Categories From Your Home Page
Placing this code in index.php file will cause the home page to display posts from all categories except category ID 3.
<?php
if ( is_home() ) {
query_posts( 'cat=-3' );
}
?>
You can also add some more categories to the exclude-list (tested with WP 3.3.1):
<?php
if ( is_home() ) {
query_posts( 'cat=-1,-2,-3' );
}
?>
Retrieve a Particular Post
To retrieve a particular post, you could use the following:
query_posts( 'p=5' );
Note: If the particular post is an attachment, you have to use attachment_id instead of p:
query_posts( 'attachment_id=5' );
If you want to use the Read More functionality with this query, you will need to set the global $more variable to 0.
<?php
// retrieve one post with an ID of 5
query_posts( 'p=5' );
// set $more to 0 in order to only get the first part of the post
global $more;
$more = 0;
// the Loop
while (have_posts()) : the_post();
the_content( 'Read the full post »' );
endwhile;
?>