2015-07-20 22 views
-1

帖子我需要顯示在WordPress的最新的帖子像顯示WordPress的

<div class="your-tab"> 

<p class="min-title">The title of video here</p> 
</a> 
<a href="#"> 
<img src="images/images4.jpg" alt="" /> 

<p class="min-title">The title of video here</p> 
</a> 
<a href="#"> 
<img src="images/images4.jpg" alt="" /> 

<p class="min-title">The title of video hereا</p> 
</a> 
<a href="#"> 
<img src="images/images4.jpg" alt="" /> 

<p class="min-title">The title of video here</p> 
</a> 
<a href="#"> 
<img src="images/images4.jpg" alt="" /> 

<p class="min-title">The title of video here</p> 
</a> 

</div> 

請「圖像/ images4.jpg」更改爲拇指和「這裏的視頻的標題「發帖標題請幫忙

+4

這個網站是不是爲了獲得免費的代碼。你需要做一些基礎研究和了解WordPress的查詢和循環 – rnevius

+0

https://wordpress.org/support/topic/display-most-recent-posts-on-static-homepage-how –

回答

0

這有幾種方法;這裏是一個; 它也可以幫助,如果你告訴我們你試圖做到這一點,並在視頻的jQuery滑塊?

<?php query_posts('cat=-20'); ?> 
<li> 
    <h2>Recent Posts</h2> 
    <ul> 
     <?php while (have_posts()) : the_post(); ?> 
     <li><a href='<?php the_permalink() ?>'><?php the_title(); ?></a></li> 
     <?php endwhile; ?> 
    </ul> 
</li> 

看看這樣來的縮略圖:get_the_post_thumbnail

$posts = get_posts(array('posts_per_page' => 5)); 
foreach ($posts as $_post) { 
    if (has_post_thumbnail($_post->ID)) { 
     echo '<a href="' . get_permalink($_post->ID) . '" title="' . esc_attr($_post->post_title) . '">'; 
     echo get_the_post_thumbnail($_post->ID, 'thumbnail'); 
     echo '</a>'; 
    } 
} 

Read More about post thumbnail

https://codex.wordpress.org/Function_Reference/the_post_thumbnail

+0

你好,謝謝你,我想知道我可以如何獲得拇指img鏈接 – Someone