<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                一個置頂帖子的帖子將被放置在帖子頂部的頂部。 此功能僅適用于內置的帖子類型的帖子,而不適用于自定義的帖子類型。 ## 如何置頂帖子 轉到管理屏幕>帖子>添加新的或編輯 在右側菜單中,單擊發布組中的可見性編輯鏈接 點擊粘貼此帖子到首頁選項 ##顯示置頂的帖子 只顯示第一個置頂的帖子。 至少有一個帖子必須指定為“置頂帖子”,否則循環將顯示所有帖子: ``` $sticky = get_option( 'sticky_posts' ); $query = new WP_Query( 'p=' . $sticky[0] ); ``` 顯示第一個置頂的帖子,如果沒有返回最后發布的帖子: ``` $args = array( 'posts_per_page' => 1, 'post__in' => get_option( 'sticky_posts' ), 'ignore_sticky_posts' => 1 ); $query = new WP_Query( $args ); ``` 只顯示第一個置頂帖子,如果沒有返回任何內容: ``` $sticky = get_option( 'sticky_posts' ); $args = array( 'posts_per_page' => 1, 'post__in' => $sticky, 'ignore_sticky_posts' => 1 ); $query = new WP_Query( $args ); if ( isset( $sticky[0] ) ) { // insert here your stuff... } ``` ## 不顯示置頂帖子 從查詢中排除所有置頂的帖子: ``` $query = new WP_Query( array( 'post__not_in' => get_option( 'sticky_posts' ) ) ); ``` 排除類別中的置頂帖子。 返回類別中的所有帖子,但不要在頂部顯示置頂帖子。 “置頂”仍將顯示在自然的位置(例如按日期): ``` $query = new WP_Query( 'ignore_sticky_posts=1&posts_per_page=3&cat=6' ); ``` 排除類別中的置頂帖子。 返回類別中的帖子,但完全置頂粘貼帖子,并遵守分頁規則: ``` $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; $sticky = get_option( 'sticky_posts' ); $args = array( 'cat' => 3, 'ignore_sticky_posts' => 1, 'post__not_in' => $sticky, 'paged' => $paged ); $query = new WP_Query( $args ); ``` >[info] 注意:如果希望此查詢在您設置為靜態首頁的頁面模板中工作,請使用get_query_var('page')。 ``` <?php /* Get all Sticky Posts */ $sticky = get_option( 'sticky_posts' ); /* Sort Sticky Posts, newest at the top */ rsort( $sticky ); /* Get top 5 Sticky Posts */ $sticky = array_slice( $sticky, 0, 5 ); /* Query Sticky Posts */ $query = new WP_Query( array( 'post__in' => $sticky, 'ignore_sticky_posts' => 1 ) ); ?> ``` ## 風格置頂帖子 為了幫助主題作者執行更簡單的樣式,post_class()函數用于將class =“...”添加到DIV,只需添加: ``` <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> ``` post_class()輸出該div的`class="whatever"`片段。 這包括幾個不同的價值類別:post,hentry(對于hAtom微格式頁面),category-X(其中X是帖子的每個類別的塊),以及tag-X(類似的,但帶有標簽)。 它還為標記為粘滯帖子的帖子添加了“粘性”。 ``` .sticky { color:red; } ``` >[info] 注意:只有在主頁的第一頁(is_home()為true并且is_paged()為false)的置頂帖子中才添加“sticky”類。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看