2011-05-31 83 views
0

如何顯示,我的所有文章縮略圖與wordpress中的單個頁面上的標題?這裏我們只需要使用短代碼。我們可能使用jquery或其他人也需要解決。客戶詢問立即但我們不能解決這個問題。請幫我解決這個問題。如何在wordpress中的單個頁面上顯示帶有標題縮略圖的所有帖子?

+0

嘗試wordpress.stackexchange.com。你可能會發現更多的答案 – 2011-05-31 07:47:11

+0

要麼搜索Wordpress插件,要麼在自由職業者網站上發佈工作。在這裏,您可以通過增加項目預算輕鬆地讓人們從頭開始編寫代碼。 – DarthJDG 2011-05-31 08:11:29

+0

好感謝給你的建議祗園&DarthJDG .... – Ramkumar 2011-05-31 08:56:42

回答

0
<?php$ 
    args = array('numberposts' => -1); 
    // optionally put more arguments here 
    // see wordpress function reference, 'get_posts' 
    // -1 for number of posts displays all 
    $postlist = get_posts($args); 
    foreach ($postlist as $post) { 
     setup_postdata($post); 
     if (has_post_thumbnail()) { 
      echo '<h2><a href="'; 
      the_permalink(); 
      echo '">'; 
      the_title(); 
      echo '</a></h2>'; 
      the_post_thumbnail(); 
      // alter markup and style accordingly 
      // optionally add thumbnail class as function parameter 
      // as previously defined in functions.php 
     } 
    } 
?> 
+0

它的工作fine.thx Pille先生 – Ramkumar 2011-05-31 13:50:45

相關問題