我正在做一个非常简单的页面,显示多个帖子类型。如何将固定链接添加到从the_post_thumbnail
返回的值& the_content
?初学者:如何添加永久链接到WP_Query多个自定义帖子类型?
<?php
$custom_query = new WP_Query(
array(
'post_type' => array('downloads', 'bjd', 'prints'),
)
);
if ($custom_query->have_posts()) : while ($custom_query->have_posts()) : $custom_query->the_post();
the_post_thumbnail('productgal-thumb');
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>
the_content();
endwhile; endif; wp_reset_query();
?>
另外,如果我尝试在简单<div>
元素来放置这些功能格式化它打破了代码以及风格。
我做到这一点,它打破了代码:解析错误:语法错误,意想不到的 '<' – Spear
尝试编辑ANS @ Spear – Exprator
这也很精美。非常感谢! – Spear