• Anybody else found that post_type=post doesn’t exclude the pages?

    If anyone can spot a bug in this, I’d appreciate it:

    <div id="rightcol">
        <?php
    // this is where you enter the IDs of which categories you want to display
    $display_categories = array(80,60,91,118);
    foreach ($display_categories as $category) { ?>
        <div class="clearfloat">
          <?php query_posts("showposts=1&post_type=post&cat=$category");
    	    $wp_query->is_category = false;
    		$wp_query->is_archive = false;
    		$wp_query->is_home = true;
    		 ?>
          <h3><a href="<?php echo bloginfo('url'); echo "/locations/"; echo get_cat_name($category);?>"><?php
    	// this is where the name of each category gets printed
    	  single_cat_title(); ?></a>
    <br /></h3>
          <?php while (have_posts()) : the_post(); ?>
          <?php if (function_exists('get_cat_icon'))
    	  get_cat_icon('fit_width=50&fit_height=50'); ?>
    
          <a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php
    // this is where title of the article gets printed
    	  the_title(); ?>&raquo;</a>
    
          <?php endwhile; ?>
        </div>
        <?php } ?>
      </div><!--END RIGHTCOL-->
Viewing 4 replies - 1 through 4 (of 4 total)
  • rjharv

    (@rjharv)

    I’m getting the same error now! Did you resolve this?

    global $post;
    $type = $post->post_type;
     if($type == "post") {
        ..........................
     }

    I still get matches on pages.

    rjharv

    (@rjharv)

    I think this might have something to do with wp_list_pages, in my case i’m trying to wrap <tags> arrounf the output from the_title(); That parts working fine but when WP is printing out wp_list_pages it also wraps the tags around the link but using the credentials of my first post!

    I’m trying to debug now.

    Thread Starter brockangelo

    (@brockangelo)

    I still haven’t found what causes this. One thought I had was that my page_category plugin was causing the problem. I’m not at work, but I think I use the “page_category_plus” plugin to categorize my pages. Do you use the same?

    I also have this problem *bump*

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘“post_type=post” not excluding pages’ is closed to new replies.