• Resolved dgissen

    (@dgissen)


    Hi: I have the following loop on my taxonomy.php file:

    <?php if ( have_posts() ) : ?>
    <?php /* Start the Loop */ ?>
    <?php query_posts('&orderby=name&order=ASC'.'post_type=producers'); ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <?php get_template_part( 'content-archive' ); ?>
    <?php endwhile; ?>

    I am trying to filter out all custom post types except “producers”; the alphabetical function in query_posts works, but it is showing all of the custom post types. It is not filtering out the other post types. What am I doing wrong? Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter dgissen

    (@dgissen)

    Every time I ask the wordpress forum for help, I figure out my problem:

    Works well:

    <?php if ( have_posts() ) : ?>
    
    		<?php /* Start the Loop */ ?>
    
    <?php query_posts($query_string . '&orderby=title&order=ASC'); ?> 
    
    			<?php while ( have_posts() ) : the_post(); ?>
    
    				<?php if ( 'winez' != get_post_type()  ) : ?>  
    
    				<?php get_template_part( 'content-archive' ); ?>
    
    				<?php endif; ?>
    
    			<?php endwhile; ?>
Viewing 1 replies (of 1 total)
  • The topic ‘query_posts not working – help!’ is closed to new replies.