• charles_i

    (@charles_i)


    Apparently this code should work, but it doesn’t. Is this a bug?
    The category is named ‘scoop’ in the Dashboard and here:

    $loop = new WP_Query(
    	array(
    		'posts_per_page' => -1,
    		'ignore_sticky_posts' => true,
    		'tax_query' => array(
    			array(
    				'taxonomy' => 'category',
    				'field' => 'slug',
    				'terms' => array( 'scoop' ),
    				'include_children' => false,
    			)
    		)
    	)
    );
    
    while ( $loop->have_posts() ) :
    
    	$loop->the_post();
    
    $loop->the_post();  ?>
    
      <li> <a style='font-size:14px; line-height:1.3m;'
             href="<?php the_permalink() ?>"<?php the_title(); ?>">
             <?php the_title(); ?>
        </a> </li>
    
    endwhile;
  • The topic ‘How can I list one category of post links without its child links’ is closed to new replies.