StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excluding specific header tabs Robert Barr General Discussion 7 05-02-2009 03:27 PM
Excluding posts from category archives wifeunit General Discussion 1 01-12-2009 06:34 AM


All times are GMT -5. The time now is 01:12 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.