• Resolved nolimit966

    (@nolimit966)


    Hello there,
    Im creating my own WordPress theme from scratch & wanting to know how i can exclude certain categories from a specific feed. At present i currently have the following on my blog page:

    <?php query_posts('post_type=post&post_status=publish&posts_per_page=10&paged='. get_query_var('paged')); ?>
    	<?php if( have_posts() ): ?>
            <?php while( have_posts() ): the_post(); ?>
    	    	<div id="post-<?php get_the_ID(); ?>" <?php post_class(); ?>>
    			<?php
    				$attachment_id = get_post_thumbnail_id(); // attachment ID
    				$image_attributes = wp_get_attachment_image_src( $attachment_id,'full' ); // returns an array
    			?> 
    
            	<a href="<?php the_permalink(); ?>"></a>
                <h2><a class="blogposttitle" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    
                <span class="meta"><?php the_time('F jS, Y'); ?>   &nbsp;/&nbsp;    Posted by <?php the_author_link(); ?> &nbsp;/&nbsp;
                <span class="comments">&nbsp;<?php comments_popup_link(__('0 comments','example'),__('1 comment','example'),__('% comments','example')); ?>
                </span>
                </span>
    
                <div class="dots"></div>
                <p><img src="<?php bloginfo('url'); ?>/imgresize.php?src=<?php echo $image_attributes[0]; ?>&h=200&w=800&q=100"></p> 
    
    			<?php
    			if (function_exists('has_excerpt') && has_excerpt())
    			the_excerpt();
    			else the_content('Read on...');?>
    
    			<?php
                if (function_exists('has_excerpt') && has_excerpt()) { ?>
                <a href="<?php the_permalink() ?>" title="Continue Reading <?php the_title_attribute(); ?>...">Read more&raquo;</a>
    			<?php  } ?>
    
                </div><!-- /#post-<?php get_the_ID(); ?> -->
    
                 <?php endwhile; ?>
    
                 <div class="navigation">
    			<span class="newer"><?php previous_posts_link(__('? Newer','example')) ?></span> <span class="older"><?php next_posts_link(__('Older ?','example')) ?></span>
                </div><!-- /.navigation -->
    
    			<?php else: ?>
                <div id="post-404" class="noposts">
                <p><?php _e('None found.','example'); ?></p>
                </div><!-- /#post-404 -->
    
    			<?php endif; wp_reset_query(); ?>
                </div>

    I have tried to play around with the query posts, but as i am not a php developer i keep getting errors. I have had a search through the forum yesterday but i cant relate the work to my own.

    If anyone could give a few pointers i’d really appreciate it.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter nolimit966

    (@nolimit966)

    I have tried to add $query_string . ‘&cat=-230’. before the <?php query_posts( but nothing happens. I have also tried to remove the category from the query but not luck. If anyone could give e a pointer id really appreciate it.

    Cheers

    Thread Starter nolimit966

    (@nolimit966)

    I have managed to do this by just including the blog category i.d (‘cat=31’) in the <?php query_posts> and it worked a treat.

    Thanks anyway

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help exclude categories from the blog feed’ is closed to new replies.