導讀:網站搭建網站搭建有些時候我們需要調用 wordpress 置頂文章并單獨顯示出來,可以通過 WP_Query 來實現,代碼如下:">
有些時候我們需要調用 wordpdede免費模板ress 置頂文章并單獨顯示出來,可以通過 WP_Query 來實現,代碼如下:
<?php
$args = array(
'posts_per_page' => -1,
'post__in' => get_option( 'sticky_posts' )
);
$sticky_posts = new WP_Query( $args );
while ( $sticky_posts->have_posts() ) : $sticky_posts->the_post();?> &nbs織夢網站模板p;
&織夢模板免費下裁lt;li>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
</li>
<?php endwhile; wp_reset_query();?> 相關建站文章建站技術模板。
關鍵詞標簽: WordPress 文章 置頂
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-07-23 ,文章wordpress調用置頂文章,網站搭建主要講述置頂,文章,wordpress網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_35641.html