1.找到你需要顯示置頂文章的代碼位置,插入如下代碼:
$sticky = get_option('sticky_posts');
rsort( $sticky );
$sticky = array_slice( $sticky, 0, 5);
query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1,'showposts' => 4,'cat' =>5) );
?>
顯示內容代碼,可以自己設置。
沒有數據。
2.調整顯示內容的代碼樣式等,最終效果如圖。
原作者: 三星迷