我正在做一個非常簡單的頁面,顯示多個帖子類型。如何將固定鏈接添加到從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