我有這樣的代碼,以顯示他們的第一個崗位類別和縮略圖的所有職務。如何使WordPress的簡碼
<?php $recent = new WP_Query(); ?>
<?php $recent->query('cat=1&showposts=5'); ?>
<?php $is_first_post = true; ?>
<?php while($recent->have_posts()) : $recent->the_post(); ?>
<ul>
<li>
<?php
if ($is_first_post && has_post_thumbnail()) {
the_post_thumbnail();
$is_first_post = false;
}
?>
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</li>
</ul>
<?php endwhile; ?>
,但我想這顯示使用shortcode.which使用&類職位數 ,但我不能讓簡碼
先生,這段代碼顯示錯誤時,我把我現在可以做functions.php .how現在呢? –