我的自定义查询工作正常,除非调试时抛出错误:
未定义的偏移量:0 in/wp includes/query。php
以下是我的查询:
<?php $loop = new wp_query(\'post_type=car&category_name=\'.get_the_title());?>
<?php if( $loop->have_posts() ) : ?>
<table style="width: 100%">
<col style="width:35%">
<col style="width:30%">
<col style="width:20%">
<col style="width:15%">
<thead>
<tr>
<th>Name</th>
<th>Style</th>
<th>ABC</th>
<th>Rating</th>
</tr>
</thead>
<tbody>
<?php while( $loop->have_posts() ) : $loop->the_post(); ?>
<tr>
<td><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></td>
<td><?php $style = get_post_meta( get_the_ID(), \'style\', true); echo $style; ?></td>
<td><?php $abc = get_post_meta( get_the_ID(), \'abc\', true); echo $abc; ?></td>
<td><?php $rating = get_post_meta( get_the_ID(), \'rating\', true); echo $rating; ?></td>
</tr>
<?php endwhile; else: endif; ?>
</tbody>
</table>
我查找了未定义的偏移量:0,但我似乎无法找出此处缺少的内容。怎么了?