Wordpress如何調用置頂文章?

Tags: 文章, 置頂,

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.調整顯示內容的代碼樣式等,最終效果如圖。

原作者: 三星迷

相關問題答案