WordPress教程:置顶文章显示在分类/标签等存档页的最上方

前端之家收集整理的这篇文章主要介绍了WordPress教程:置顶文章显示在分类/标签等存档页的最上方前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

wordpress自带文章置顶功能,只支持首页置顶文章在顶部显示,在分类标签、作者和日期等存档页面,就没法让置顶文章在顶部显示了,只能按默认的顺序显示。在使用wordpress建站的过程中,很多时候,我们需要把置顶文章显示在这些存档页面的顶部。

这篇wordpress教程里,我们参考 wp-includes/query.PHP首页置顶代码,稍做修改,向大家讲解一下存档页面的顶部显示置顶文章方法

切换到主题目录,打开functions.PHP文件添加如下代码

Crayon-5c891d050040f097552692" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">functions.PHP
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d050040f097552692-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-2">2
Crayon-num" data-line="Crayon-5c891d050040f097552692-3">3
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-4">4
Crayon-num" data-line="Crayon-5c891d050040f097552692-5">5
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-6">6
Crayon-num" data-line="Crayon-5c891d050040f097552692-7">7
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-8">8
Crayon-num" data-line="Crayon-5c891d050040f097552692-9">9
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-10">10
Crayon-num" data-line="Crayon-5c891d050040f097552692-11">11
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-12">12
Crayon-num" data-line="Crayon-5c891d050040f097552692-13">13
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-14">14
Crayon-num" data-line="Crayon-5c891d050040f097552692-15">15
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-16">16
Crayon-num" data-line="Crayon-5c891d050040f097552692-17">17
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-18">18
Crayon-num" data-line="Crayon-5c891d050040f097552692-19">19
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-20">20
Crayon-num" data-line="Crayon-5c891d050040f097552692-21">21
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-22">22
Crayon-num" data-line="Crayon-5c891d050040f097552692-23">23
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-24">24
Crayon-num" data-line="Crayon-5c891d050040f097552692-25">25
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-26">26
Crayon-num" data-line="Crayon-5c891d050040f097552692-27">27
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-28">28
Crayon-num" data-line="Crayon-5c891d050040f097552692-29">29
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-30">30
Crayon-num" data-line="Crayon-5c891d050040f097552692-31">31
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-32">32
Crayon-num" data-line="Crayon-5c891d050040f097552692-33">33
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-34">34
Crayon-num" data-line="Crayon-5c891d050040f097552692-35">35
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-36">36
Crayon-num" data-line="Crayon-5c891d050040f097552692-37">37
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-38">38
Crayon-num" data-line="Crayon-5c891d050040f097552692-39">39
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-40">40
Crayon-num" data-line="Crayon-5c891d050040f097552692-41">41
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-42">42
Crayon-num" data-line="Crayon-5c891d050040f097552692-43">43
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-44">44
Crayon-num" data-line="Crayon-5c891d050040f097552692-45">45
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-46">46
Crayon-num" data-line="Crayon-5c891d050040f097552692-47">47
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-48">48
Crayon-num" data-line="Crayon-5c891d050040f097552692-49">49
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-50">50
Crayon-num" data-line="Crayon-5c891d050040f097552692-51">51
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-52">52
Crayon-num" data-line="Crayon-5c891d050040f097552692-53">53
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-54">54
Crayon-num" data-line="Crayon-5c891d050040f097552692-55">55
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-56">56
Crayon-num" data-line="Crayon-5c891d050040f097552692-57">57
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-58">58
Crayon-num" data-line="Crayon-5c891d050040f097552692-59">59
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-60">60
Crayon-num" data-line="Crayon-5c891d050040f097552692-61">61
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-62">62
Crayon-num" data-line="Crayon-5c891d050040f097552692-63">63
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-64">64
Crayon-num" data-line="Crayon-5c891d050040f097552692-65">65
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-66">66
Crayon-num" data-line="Crayon-5c891d050040f097552692-67">67
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-68">68
Crayon-num" data-line="Crayon-5c891d050040f097552692-69">69
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-70">70
Crayon-num" data-line="Crayon-5c891d050040f097552692-71">71
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-72">72
Crayon-num" data-line="Crayon-5c891d050040f097552692-73">73
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-74">74
Crayon-num" data-line="Crayon-5c891d050040f097552692-75">75
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-76">76
Crayon-num" data-line="Crayon-5c891d050040f097552692-77">77
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-78">78
Crayon-num" data-line="Crayon-5c891d050040f097552692-79">79
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-80">80
Crayon-num" data-line="Crayon-5c891d050040f097552692-81">81
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-82">82
Crayon-num" data-line="Crayon-5c891d050040f097552692-83">83
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-84">84
Crayon-num" data-line="Crayon-5c891d050040f097552692-85">85
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050040f097552692-86">86
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d050040f097552692-1">Crayon-e">add_filterCrayon-sy">(Crayon-s">'the_posts'Crayon-sy">,Crayon-h">Crayon-s">'putStickyOnTop'Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-2">Crayon-t">functionCrayon-h"> Crayon-e">putStickyOnTopCrayon-sy">(Crayon-h"> Crayon-v">$postsCrayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line" id="Crayon-5c891d050040f097552692-3">Crayon-h">Crayon-st">ifCrayon-sy">(Crayon-e">is_homeCrayon-sy">(Crayon-sy">)Crayon-h"> Crayon-o">||Crayon-h"> Crayon-o">!Crayon-e">is_main_queryCrayon-sy">(Crayon-sy">)Crayon-h"> Crayon-o">||Crayon-h"> Crayon-o">!Crayon-e">is_archiveCrayon-sy">(Crayon-sy">)Crayon-sy">)
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-4">Crayon-h">Crayon-k ">returnCrayon-h"> Crayon-v">$postsCrayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-5">Crayon-h">
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-6">Crayon-h">Crayon-m">globalCrayon-h"> Crayon-v">$wp_queryCrayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-7">
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-8">Crayon-h">Crayon-c">// 获取所有置顶文章
Crayon-line" id="Crayon-5c891d050040f097552692-9">Crayon-h">Crayon-v">$sticky_postsCrayon-h"> Crayon-o">=Crayon-h"> Crayon-e">get_optionCrayon-sy">(Crayon-s">'sticky_posts'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-10">Crayon-h">
Crayon-line" id="Crayon-5c891d050040f097552692-11">Crayon-h">Crayon-st">ifCrayon-h"> Crayon-sy">(Crayon-h"> Crayon-v">$wp_queryCrayon-i">query_varsCrayon-sy">[Crayon-s">'paged'Crayon-sy">]Crayon-h"> Crayon-o"><=Crayon-h"> Crayon-cn">1Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-o">!Crayon-k ">emptyCrayon-sy">(Crayon-v">$sticky_postsCrayon-sy">)Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-e">is_arrayCrayon-sy">(Crayon-v">$sticky_postsCrayon-sy">)Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-o">!Crayon-e">get_query_varCrayon-sy">(Crayon-s">'ignore_sticky_posts'Crayon-sy">)Crayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-12">Crayon-h">Crayon-v">$stickies1Crayon-h"> Crayon-o">=Crayon-h"> Crayon-e">get_postsCrayon-sy">(Crayon-h"> Crayon-t">arrayCrayon-sy">(Crayon-h"> Crayon-s">'post__in'Crayon-h"> Crayon-o">=Crayon-h"> Crayon-v">$sticky_postsCrayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-13">Crayon-h">Crayon-st">foreachCrayon-h"> Crayon-sy">(Crayon-h"> Crayon-v">$stickies1Crayon-h"> Crayon-st">asCrayon-h"> Crayon-v">$sticky_post1Crayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-14">Crayon-h">Crayon-c">// 判断当前是否分类
Crayon-line" id="Crayon-5c891d050040f097552692-15">Crayon-h">Crayon-st">ifCrayon-sy">(Crayon-v">$wp_queryCrayon-i">is_categoryCrayon-h"> Crayon-o">==Crayon-h"> Crayon-cn">1Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-o">!Crayon-e">has_categoryCrayon-sy">(Crayon-v">$wp_queryCrayon-i">query_varsCrayon-sy">[Crayon-s">'cat'Crayon-sy">]Crayon-sy">,Crayon-h"> Crayon-v">$sticky_post1Crayon-cn">IDCrayon-sy">)Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-16">Crayon-h">Crayon-c">// 去除不属于本分类置顶文章
Crayon-line" id="Crayon-5c891d050040f097552692-17">Crayon-h">Crayon-v">$offset1Crayon-h"> Crayon-o">=Crayon-h"> Crayon-e">array_searchCrayon-sy">(Crayon-v">$sticky_post1Crayon-cn">IDCrayon-sy">,Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-18">Crayon-h">Crayon-k ">unsetCrayon-sy">(Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">[Crayon-v">$offset1Crayon-sy">]Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-19">Crayon-h">Crayon-sy">}
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-20">Crayon-h">Crayon-st">ifCrayon-sy">(Crayon-v">$wp_queryCrayon-i">is_tagCrayon-h"> Crayon-o">==Crayon-h"> Crayon-cn">1Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-o">!Crayon-e">has_tagCrayon-sy">(Crayon-v">$wp_queryCrayon-i">query_varsCrayon-sy">[Crayon-s">'tag'Crayon-sy">]Crayon-sy">,Crayon-h"> Crayon-v">$sticky_post1Crayon-cn">IDCrayon-sy">)Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line" id="Crayon-5c891d050040f097552692-21">Crayon-h">Crayon-c">// 去除不属于本标签文章
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-22">Crayon-h">Crayon-v">$offset1Crayon-h"> Crayon-o">=Crayon-h"> Crayon-e">array_searchCrayon-sy">(Crayon-v">$sticky_post1Crayon-cn">IDCrayon-sy">,Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-23">Crayon-h">Crayon-k ">unsetCrayon-sy">(Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">[Crayon-v">$offset1Crayon-sy">]Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-24">Crayon-h">Crayon-sy">}
Crayon-line" id="Crayon-5c891d050040f097552692-25">Crayon-h">Crayon-st">ifCrayon-sy">(Crayon-v">$wp_queryCrayon-i">is_yearCrayon-h"> Crayon-o">==Crayon-h"> Crayon-cn">1Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-e">date_i18nCrayon-sy">(Crayon-s">'Y'Crayon-sy">,Crayon-h"> Crayon-e">strtotimeCrayon-sy">(Crayon-v">$sticky_post1Crayon-i">post_dateCrayon-sy">)Crayon-sy">)Crayon-o">!=Crayon-v">$wp_queryCrayon-i">queryCrayon-sy">[Crayon-s">'m'Crayon-sy">]Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-26">Crayon-h">Crayon-c">// 去除不属于本年份的文章
Crayon-line" id="Crayon-5c891d050040f097552692-27">Crayon-h">Crayon-v">$offset1Crayon-h"> Crayon-o">=Crayon-h"> Crayon-e">array_searchCrayon-sy">(Crayon-v">$sticky_post1Crayon-cn">IDCrayon-sy">,Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-28">Crayon-h">Crayon-k ">unsetCrayon-sy">(Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">[Crayon-v">$offset1Crayon-sy">]Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-29">Crayon-h">Crayon-sy">}
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-30">Crayon-h">Crayon-st">ifCrayon-sy">(Crayon-v">$wp_queryCrayon-i">is_monthCrayon-h"> Crayon-o">==Crayon-h"> Crayon-cn">1Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-e">date_i18nCrayon-sy">(Crayon-s">'Ym'Crayon-sy">,Crayon-h"> Crayon-e">strtotimeCrayon-sy">(Crayon-v">$sticky_post1Crayon-i">post_dateCrayon-sy">)Crayon-sy">)Crayon-o">!=Crayon-v">$wp_queryCrayon-i">queryCrayon-sy">[Crayon-s">'m'Crayon-sy">]Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line" id="Crayon-5c891d050040f097552692-31">Crayon-h">Crayon-c">// 去除不属于本月份的文章
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-32">Crayon-h">Crayon-v">$offset1Crayon-h"> Crayon-o">=Crayon-h"> Crayon-e">array_searchCrayon-sy">(Crayon-v">$sticky_post1Crayon-cn">IDCrayon-sy">,Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-33">Crayon-h">Crayon-k ">unsetCrayon-sy">(Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">[Crayon-v">$offset1Crayon-sy">]Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-34">Crayon-h">Crayon-sy">}
Crayon-line" id="Crayon-5c891d050040f097552692-35">Crayon-h">Crayon-st">ifCrayon-sy">(Crayon-v">$wp_queryCrayon-i">is_dayCrayon-h"> Crayon-o">==Crayon-h"> Crayon-cn">1Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-e">date_i18nCrayon-sy">(Crayon-s">'Ymd'Crayon-sy">,Crayon-h"> Crayon-e">strtotimeCrayon-sy">(Crayon-v">$sticky_post1Crayon-i">post_dateCrayon-sy">)Crayon-sy">)Crayon-o">!=Crayon-v">$wp_queryCrayon-i">queryCrayon-sy">[Crayon-s">'m'Crayon-sy">]Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-36">Crayon-h">Crayon-c">// 去除不属于本日期的文章
Crayon-line" id="Crayon-5c891d050040f097552692-37">Crayon-h">Crayon-v">$offset1Crayon-h"> Crayon-o">=Crayon-h"> Crayon-e">array_searchCrayon-sy">(Crayon-v">$sticky_post1Crayon-cn">IDCrayon-sy">,Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-38">Crayon-h">Crayon-k ">unsetCrayon-sy">(Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">[Crayon-v">$offset1Crayon-sy">]Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-39">Crayon-h">Crayon-sy">}
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-40">Crayon-h">Crayon-st">ifCrayon-sy">(Crayon-v">$wp_queryCrayon-i">is_authorCrayon-h"> Crayon-o">==Crayon-h"> Crayon-cn">1Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-v">$sticky_post1Crayon-i">post_authorCrayon-h"> Crayon-o">!=Crayon-h"> Crayon-v">$wp_queryCrayon-i">query_varsCrayon-sy">[Crayon-s">'author'Crayon-sy">]Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line" id="Crayon-5c891d050040f097552692-41">Crayon-h">Crayon-c">// 去除不属于本作者的文章
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-42">Crayon-h">Crayon-v">$offset1Crayon-h"> Crayon-o">=Crayon-h"> Crayon-e">array_searchCrayon-sy">(Crayon-v">$sticky_post1Crayon-cn">IDCrayon-sy">,Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-43">Crayon-h">Crayon-k ">unsetCrayon-sy">(Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">[Crayon-v">$offset1Crayon-sy">]Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-44">Crayon-h">Crayon-sy">}
Crayon-line" id="Crayon-5c891d050040f097552692-45">Crayon-h">Crayon-sy">}
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-46">Crayon-h">
Crayon-line" id="Crayon-5c891d050040f097552692-47">Crayon-h">Crayon-v">$num_postsCrayon-h"> Crayon-o">=Crayon-h"> Crayon-e">countCrayon-sy">(Crayon-v">$postsCrayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-48">Crayon-h">Crayon-v">$sticky_offsetCrayon-h"> Crayon-o">=Crayon-h"> Crayon-cn">0Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-49">Crayon-h">Crayon-c">// Loop over posts and relocate stickies to the front.
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-50">Crayon-h">Crayon-st">forCrayon-h"> Crayon-sy">(Crayon-h"> Crayon-v">$iCrayon-h"> Crayon-o">=Crayon-h"> Crayon-cn">0Crayon-sy">;Crayon-h"> Crayon-v">$iCrayon-h"> Crayon-o"><Crayon-h"> Crayon-v">$num_postsCrayon-sy">;Crayon-h"> Crayon-v">$iCrayon-o">++Crayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line" id="Crayon-5c891d050040f097552692-51">Crayon-h">Crayon-st">ifCrayon-h"> Crayon-sy">(Crayon-h"> Crayon-e">in_arrayCrayon-sy">(Crayon-v">$postsCrayon-sy">[Crayon-v">$iCrayon-sy">]Crayon-cn">IDCrayon-sy">,Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">)Crayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-52">Crayon-h">Crayon-v">$sticky_postCrayon-h"> Crayon-o">=Crayon-h"> Crayon-v">$postsCrayon-sy">[Crayon-v">$iCrayon-sy">]Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-53">Crayon-h">Crayon-c">// Remove sticky from current position
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-54">Crayon-h">Crayon-e">array_spliceCrayon-sy">(Crayon-v">$postsCrayon-sy">,Crayon-h"> Crayon-v">$iCrayon-sy">,Crayon-h"> Crayon-cn">1Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-55">Crayon-h">Crayon-c">// Move to front,after other stickies
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-56">Crayon-h">Crayon-e">array_spliceCrayon-sy">(Crayon-v">$postsCrayon-sy">,Crayon-h"> Crayon-v">$sticky_offsetCrayon-sy">,Crayon-h"> Crayon-cn">0Crayon-sy">,Crayon-h"> Crayon-t">arrayCrayon-sy">(Crayon-v">$sticky_postCrayon-sy">)Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-57">Crayon-h">Crayon-c">// Increment the sticky offset. The next sticky will be placed at this offset.
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-58">Crayon-h">Crayon-v">$sticky_offsetCrayon-o">++Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-59">Crayon-h">Crayon-c">// Remove post from sticky posts array
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-60">Crayon-h">Crayon-v">$offsetCrayon-h"> Crayon-o">=Crayon-h"> Crayon-e">array_searchCrayon-sy">(Crayon-v">$sticky_postCrayon-cn">IDCrayon-sy">,Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-61">Crayon-h">Crayon-k ">unsetCrayon-sy">(Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">[Crayon-v">$offsetCrayon-sy">]Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-62">Crayon-h">Crayon-sy">}
Crayon-line" id="Crayon-5c891d050040f097552692-63">Crayon-h">Crayon-sy">}
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-64">
Crayon-line" id="Crayon-5c891d050040f097552692-65">Crayon-h">Crayon-c">// If any posts have been excluded specifically,Ignore those that are sticky.
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-66">Crayon-h">Crayon-st">ifCrayon-h"> Crayon-sy">(Crayon-h"> Crayon-o">!Crayon-k ">emptyCrayon-sy">(Crayon-v">$sticky_postsCrayon-sy">)Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-o">!Crayon-k ">emptyCrayon-sy">(Crayon-v">$wp_queryCrayon-i">query_varsCrayon-sy">[Crayon-s">'post__not_in'Crayon-sy">]Crayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">)
Crayon-line" id="Crayon-5c891d050040f097552692-67">Crayon-h">Crayon-v">$sticky_postsCrayon-h"> Crayon-o">=Crayon-h"> Crayon-e">array_diffCrayon-sy">(Crayon-v">$sticky_postsCrayon-sy">,Crayon-h"> Crayon-v">$wp_queryCrayon-i">query_varsCrayon-sy">[Crayon-s">'post__not_in'Crayon-sy">]Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-68">
Crayon-line" id="Crayon-5c891d050040f097552692-69">Crayon-h">Crayon-c">// Fetch sticky posts that weren't in the query results
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-70">Crayon-h">Crayon-st">ifCrayon-h"> Crayon-sy">(Crayon-h"> Crayon-o">!Crayon-k ">emptyCrayon-sy">(Crayon-v">$sticky_postsCrayon-sy">)Crayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line" id="Crayon-5c891d050040f097552692-71">Crayon-h">Crayon-v">$stickiesCrayon-h"> Crayon-o">=Crayon-h"> Crayon-e">get_postsCrayon-sy">(Crayon-h"> Crayon-t">arrayCrayon-sy">(
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-72">Crayon-h">Crayon-s">'post__in'Crayon-h"> Crayon-o">=Crayon-h"> Crayon-v">$sticky_postsCrayon-sy">,
Crayon-line" id="Crayon-5c891d050040f097552692-73">Crayon-h">Crayon-s">'post_type'Crayon-h"> Crayon-o">=Crayon-h"> Crayon-v">$wp_queryCrayon-i">query_varsCrayon-sy">[Crayon-s">'post_type'Crayon-sy">]Crayon-sy">,
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-74">Crayon-h">Crayon-s">'post_status'Crayon-h"> Crayon-o">=Crayon-h"> Crayon-s">'publish'Crayon-sy">,
Crayon-line" id="Crayon-5c891d050040f097552692-75">Crayon-h">Crayon-s">'nopaging'Crayon-h"> Crayon-o">=Crayon-h"> Crayon-t">true
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-76">Crayon-h">Crayon-sy">)Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-77">
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-78">Crayon-h">Crayon-st">foreachCrayon-h"> Crayon-sy">(Crayon-h"> Crayon-v">$stickiesCrayon-h"> Crayon-st">asCrayon-h"> Crayon-v">$sticky_postCrayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line" id="Crayon-5c891d050040f097552692-79">Crayon-h">Crayon-e">array_spliceCrayon-sy">(Crayon-h"> Crayon-v">$postsCrayon-sy">,Crayon-h"> Crayon-t">arrayCrayon-sy">(Crayon-h"> Crayon-v">$sticky_postCrayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-80">Crayon-h">Crayon-v">$sticky_offsetCrayon-o">++Crayon-sy">;
Crayon-line" id="Crayon-5c891d050040f097552692-81">Crayon-h">Crayon-sy">}
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-82">Crayon-h">Crayon-sy">}
Crayon-line" id="Crayon-5c891d050040f097552692-83">Crayon-h">Crayon-sy">}
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-84">Crayon-h">
Crayon-line" id="Crayon-5c891d050040f097552692-85">Crayon-h">Crayon-k ">returnCrayon-h"> Crayon-v">$postsCrayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d050040f097552692-86">Crayon-sy">}

代码说明

1. 以上代码只对主循环有效,如果在存档页使用WP_Query或query_posts来获取显示文章列表,又想让这些列表顶部显示置顶文章,可以把第3行代码中的以下代码删掉(注意:可能会导致文章显示数量跟您设置的不一样):

Crayon-5c891d050041a229858231" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d050041a229858231-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d050041a229858231-1">Crayon-o">||Crayon-h"> Crayon-o">!Crayon-e">is_main_queryCrayon-sy">(Crayon-sy">)

2. 如果您想让存档页也都显示全部置顶文章,那么就删掉12-45行的代码

3. 如果不想在某个分类页面显示置顶文章,将第3行的

Crayon-5c891d050041c676498044" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d050041c676498044-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d050041c676498044-1">Crayon-st">ifCrayon-sy">(

修改为:

Crayon-5c891d050041e879128705" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d050041e879128705-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d050041e879128705-2">2
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d050041e879128705-1">Crayon-c">// abc是分类名称
Crayon-line Crayon-striped-line" id="Crayon-5c891d050041e879128705-2">Crayon-st">ifCrayon-h"> Crayon-sy">(Crayon-h"> Crayon-e">is_categoryCrayon-sy">(Crayon-h"> Crayon-s">'abc'Crayon-h"> Crayon-sy">)Crayon-h"> Crayon-o">||

4. 如果您不想让某作者页显示置顶文章,将第3行的

Crayon-5c891d050041f374479995" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d050041f374479995-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d050041f374479995-1">Crayon-st">ifCrayon-sy">(

修改为:

Crayon-5c891d0500420655869681" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d0500420655869681-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d0500420655869681-2">2
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d0500420655869681-1">Crayon-c">// abc是分类名称
Crayon-line Crayon-striped-line" id="Crayon-5c891d0500420655869681-2">Crayon-st">ifCrayon-h"> Crayon-sy">(Crayon-h"> Crayon-e">is_authorCrayon-sy">(Crayon-h"> Crayon-s">'abc'Crayon-h"> Crayon-sy">)Crayon-h"> Crayon-o">||

置顶文章添加样式

如果您想给置顶文章添加样式,以便和没有置顶文章区别开来,将以下代码添加到 functions.PHP 文件中,通过这段代码会给置顶文章添加一个名为 sticky 的class。然后您可以利用 css 知识给 sticky 这个 class 定义一些样式。

Crayon-5c891d0500421473055065" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">functions.PHP
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d0500421473055065-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d0500421473055065-2">2
Crayon-num" data-line="Crayon-5c891d0500421473055065-3">3
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d0500421473055065-4">4
Crayon-num" data-line="Crayon-5c891d0500421473055065-5">5
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d0500421473055065-6">6
Crayon-num" data-line="Crayon-5c891d0500421473055065-7">7
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d0500421473055065-8">8
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d0500421473055065-1">Crayon-e">add_filterCrayon-sy">(Crayon-s">'post_class'Crayon-sy">,Crayon-h">Crayon-s">'addStickyClass'Crayon-h"> Crayon-sy">,Crayon-cn">10Crayon-sy">,Crayon-cn">3Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d0500421473055065-2">Crayon-t">functionCrayon-h"> Crayon-e">addStickyClassCrayon-sy">(Crayon-h"> Crayon-v">$classesCrayon-sy">,Crayon-h"> Crayon-v">$classCrayon-sy">,Crayon-h"> Crayon-v">$post_idCrayon-h"> Crayon-sy">)Crayon-sy">{
Crayon-line" id="Crayon-5c891d0500421473055065-3">Crayon-h">Crayon-st">ifCrayon-sy">(Crayon-h"> Crayon-e">is_stickyCrayon-sy">(Crayon-sy">)Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-e">is_categoryCrayon-sy">(Crayon-sy">)Crayon-h"> Crayon-o">&&Crayon-h"> Crayon-o">!Crayon-k ">issetCrayon-sy">(Crayon-h"> Crayon-v">$classesCrayon-sy">[Crayon-s">'sticky'Crayon-sy">]Crayon-h"> Crayon-sy">)Crayon-h"> Crayon-sy">)Crayon-sy">{
Crayon-line Crayon-striped-line" id="Crayon-5c891d0500421473055065-4">Crayon-h">Crayon-v">$classesCrayon-sy">[Crayon-sy">]Crayon-h"> Crayon-o">=Crayon-h"> Crayon-s">'sticky'Crayon-sy">;
Crayon-line" id="Crayon-5c891d0500421473055065-5">Crayon-h">Crayon-sy">}
Crayon-line Crayon-striped-line" id="Crayon-5c891d0500421473055065-6">Crayon-h">
Crayon-line" id="Crayon-5c891d0500421473055065-7">Crayon-h">Crayon-k ">returnCrayon-h"> Crayon-v">$classesCrayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d0500421473055065-8">Crayon-sy">}

原文链接:https://www.f2er.com/wordpress/238436.html

猜你在找的wordpress相关文章