0
我想創建報紙網站和需要幫助,以顯示最近的文章中,只有舊文章的標題的內容...這裏是我的代碼 如何顯示的第一篇文章的內容和鏈接老年後只在WordPress
<?php
$args = array(
'orderby' => 'id',
'hide_empty' => 1,
'order' => 'ASC'
);
$categories = get_categories($args);
foreach($categories as $category) { ?>
<div class="newsdiv">
<?php
echo '<center><a href="' . get_category_link($category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . '>' . $category->name.'</a></center> <br/> ';
$post_args = array(
'numberposts' => 3,
'category' => $category->term_id
);
$posts = get_posts($post_args);
foreach($posts as $post) {?>
<a href="<?php the_permalink(); ?>"><?php echo"*";the_title(); ?></a>
<div class="entry">
<?php the_content(); ?>
</div>
<?php
}
echo '<dd class="view-all"> <a href="' . get_category_link($category->term_id) . '" title="' . sprintf(__("View all posts in %s"), $category->name) . '" ' . '>Read more </a></dd>';
echo '</dl>';
?>
</div>
<?php
}
?>
,問題是......? –