【发布时间】:2017-05-22 18:59:30
【问题描述】:
我有一个 Wp_Query 来遍历我的自定义帖子类型,但它似乎是错误的,但我看不到错误。在帖子缩略图之后,我可以看到(>)好像某些标签没有正确关闭,但我尝试了一些不同的方法都无济于事。
<?php
$args = array(
"post_type" => "piso"
);
$the_query = new WP_Query( $args );
?>
<?php if( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="pisos-grid-item-wrap">
<a href="<?php the_permalink(); ?>">
<img src="<?php the_post_thumbnail( 'post-thumbnail', array('width'=>'270') ); ?>">
</a>
<h1> <?php echo $precio ?> € </h1>
<h2> <?php the_title(); ?> </h2>
<h3> <?php echo $donde ?> </h3>
</div>
<?php endwhile; endif; ?>
【问题讨论】:
标签: wordpress custom-post-type