我想在头版上问几个问题。php和我不知道为什么这不起作用。我的第一个查询工作正常,但是,我的第二个指定类别的查询(甚至什么都没有)从不返回任何内容。有什么想法吗?
<div class="row">
  <div class="details">
    <?php 
        if (have_posts()) : while (have_posts()) : the_post(); 
        the_content(); 
        endwhile; else : ?>
        <p><?php _e( \'Sorry, no posts matched your criteria.\' ); ?></p>
    <?php 
        endif; 
        wp_reset_postdata(); ?>
    <?php
        $secondary_query = new WP_Query( \'category_name=students\' );        
        echo \'<ul>\';
        if ($secondary_query->have_posts()) : while ($secondary_query->have_posts()) : $secondary_query->the_post();
        echo \'<li>\' . get_the_title() . \'</li>\';
        endwhile; else : ?>
        <p><?php _e( \'Sorry, no posts matched your criteria.\' ); ?></p>
   <?php 
        echo \'</ul>\';
        endif; 
        wp_reset_postdata(); ?>
        <ul>
</div>