2016-12-24 88 views

回答

0

創建變量上表示支柱縮略圖將取決於你之前在WP_Query()archive-category.php,並改變它的價值就像年底falsy:

<?php 
$counter = 1; 
$query = new WP_Query(/* category $arguments here */); 
while($query->$have_posts) { 
    $query->the_post(); 
    if ($counter) the_post_thumbnail() 

    // rest of operations 

    $counter = 0; 
} 
+0

有任何插件?我想在wp wideget中使用它 –

+1

您可以在特定小部件中使用相同的功能,但這不是您的問題所在,因爲類別頁面不是小部件。我想不出寫插件來實現這麼簡單的事情,除非你真的沒有要求編碼。 – wscourge

+0

<?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(); ?>

  • \t \t \t \t

相關問題