View Single Post
  #1  
Old 06-21-2009, 10:08 AM
rishel rishel is offline
Registered User
Pro Plus Member
 
Join Date: Nov 2008
Posts: 173
Default Excluding Posts Except From Specific Category

Guys, posting this in general, its a code based question. If anyone can throw a possible solution at it, that would be great.

I am trying to change this code to only display from category 5 (exclude categories 1,2,3,4) and only allow 10 posts from it. Just seeing if anyone can tell me what to edit, I tried a few things, that did not work.

Here is the code for anyone that may think they can get it to work. I am assuming the edits need to be done on line 14 or 16?

Code:
<?php get_header(); ?>

<?php 
	if (is_home()) {
		include ('head_highlight.php'); 
		include ('products_highlight.php');
	}
	include ('sidebar_home.php');
?>

<div id="main-content">
	<div class="padd20">
	
		<?php if (have_posts()) : ?>
					
			<?php while (have_posts()) : the_post(); ?>
			
				<div class="post-item clearfix">
								
					<h2>"><?php the_title(); ?></h2>
					<?php 
						if ( get_post_meta($post->ID,'thumb', true) ) { 
							$thumbwidth = get_option('fancytheme_thumb_width'); // thumbnail width
							$thumbheight = get_option('fancytheme_thumb_height'); // thumbnail height
							if ( $thumbwidth && $thumbheight ) {
					?>
         			<a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark">[img]<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, [/img]&amp;h=<?php echo $thumbheight ?>&amp;w=<?php echo $thumbwidth ?>&amp;zc=1&amp;q=80" alt="<?php the_title(); ?>" /></a>
					<?php 
							} 
						}
					?>
					<h3>Posted on <?php the_time('l, F jS, Y') ?></h3>
					<?php the_excerpt(); ?>
					continue reading
					
				</div>
				
			<?php endwhile; ?>
			
				<?php if (show_posts_nav()) : ?>
				<div id="post-navigation" class="clearfix">
					<span class="previous"><?php next_posts_link('Older Entries') ?></span>
					<span class="next"><?php previous_posts_link('Newer Entries') ?></span>
				</div>
				<?php endif; ?>	
			
			<?php else : ?>
			
			<h2 class="center">Not Found</h2>
			<p class="center">Sorry, but you are looking for something that isn't here.</p>
			
		<?php endif; ?>			
		
	</div>
</div>

<?php get_footer(); ?>
__________________
I See In CMYK | http://www.ChristianRishel.info | Graphic & Vector Design, Print Media