0
您好我想要做的是與縮略圖顯示帖子,並顯示標題和前三行什麼,我試圖acheive的內容是這樣的WordPress的縮略圖顯示和設置樣式
Date
thumbnail - title
some content
目前我有精選的圖像通過,但我正在努力爭取休息,只是爲了重申我想要一個左側的特色圖像和旁邊的標題日期和內容旁邊的內容。繼承人是什麼樣子,此刻
我的繼承人功能
if (function_exists('add_theme_support')) {
add_theme_support('post-thumbnails'); } //Adds thumbnails compatibility to the theme
set_post_thumbnail_size(200, 170, true); // Sets the Post Main Thumbnails
add_image_size('recent-thumbnails', 55, 55, true); // Sets Recent Posts Thumbnails}
function recentPosts() {
$rPosts = new WP_Query();
$rPosts->query('cat=4&showposts=3&orderby=date');
while ($rPosts->have_posts()) : $rPosts->the_post(); ?>
<li>
<a href="<?php the_permalink();?>"><?php the_post_thumbnail('recent-thumbnails'); ?></a>
<h2><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
</li>
<?php endwhile;
wp_reset_query();
}
繼承人我CSS
#posts { width:600px; height:auto; float:left; margin-top:20px; font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#080808;}
#posts .news{ width:600px; height:auto; font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; display:inline-block;}
#posts a{ font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000000; display:inline-block;}
繼承人如何我稱它在我的index.php
<div class="news">
<?php echo recentPosts(); ?>
</div>