﻿{"id":2173,"date":"2023-04-06T23:00:43","date_gmt":"2023-04-06T15:00:43","guid":{"rendered":"http:\/\/81.70.49.155\/?p=2173"},"modified":"2023-04-14T08:46:25","modified_gmt":"2023-04-14T00:46:25","slug":"wp_pagenavi%e5%a4%b1%e6%95%88%e9%97%ae%e9%a2%98%e7%bb%88%e4%ba%8e%e6%90%9e%e5%ae%9a%e4%ba%86","status":"publish","type":"post","link":"http:\/\/81.70.49.155\/?p=2173","title":{"rendered":"\u641e\u5b9aWordPress\u4e2dwp_pagenavi\u5931\u6548\u95ee\u9898"},"content":{"rendered":"<p>\n\t\u771ftm\u4e0d\u5bb9\u6613\u554a\uff0cwordpress\u5c0f\u767d\u5168\u662f\u6cea\u554a\uff0c\u5de5\u592b\u4e0d\u8d1f\u6709\u5fc3\u4eba\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t&lt;?php&nbsp; \/* Template Name: shuoshuoA *\/ get_header($name); ?&gt;<\/p>\n<p>&lt;div id=\"primary\" class=\"content-area\"&gt;<br \/>\n&nbsp; &nbsp; &lt;main id=\"main\" class=\"site-main\" role=\"main\"&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=\"shuoshuo_content\"&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ul class=\"bsy_timeline\"&gt;<br \/>\n<span> <\/span><br \/>\n&lt;?php&nbsp; \/* \u8fd9\u4e00\u6bb5\u662f\u89e3\u51b3wp_pagenavi\u5931\u6548\u7684\u5173\u952e\uff0c\u7528paged\u53c2\u6570\u89e3\u51b3query\u95ee\u9898 *\/<br \/>\n$limit = get_option('posts_per_page');<br \/>\n$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;<br \/>\nquery_posts('post_type=shuoshuo&amp;post_status=publish&amp;showposts=' . $limit=2 . '&amp;paged=' . $paged);<br \/>\n$wp_query-&gt;is_archive = true; $wp_query-&gt;is_home = false;<br \/>\n?&gt;<\/p>\n<p>\n&lt;?php while (have_posts()) : the_post(); ?&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt; &lt;span class=\"author_tou\"&gt;&lt;img src=\"http:\/\/81.70.49.155\/wp-content\/uploads\/2023\/04\/tx-1.png\" class=\"avatar\" width=\"48\" height=\"48\"&gt;&lt;\/span&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;a class=\"bsy_tmlabel\" href=\"javascript:void(0)\"&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div&gt;&lt;\/div&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div&gt;&lt;?php echo $post-&gt;post_content; ?&gt;&lt;\/div&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div&gt;&lt;\/div&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=\"shuoshuo_time\"&gt;&lt;i class=\"fa fa-user\"&gt;&lt;\/i&gt;&lt;?php the_author() ?&gt;&lt;i class=\"fa fa-clock-o\"&gt;&lt;\/i&gt;&lt;?php the_time('Y\u5e74n\u6708j\u65e5G:i'); ?&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/div&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/a&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php endwhile; ?&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/li&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/ul&gt;<\/p>\n<p>\n&lt;?php if(function_exists('wp_pagenavi')) {\/\/if PageNavi is activated ?&gt;<br \/>\n&lt;?php wp_pagenavi(); \/\/ Use PageNavi ?&gt;<br \/>\n&lt;?php } else { \/\/ Otherwise, use traditional Navigation ?&gt;<br \/>\n&lt;div class=\"nav-previous\"&gt;<br \/>\n&lt;!\u2013 next_post_link \u2013&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;div class=\"nav-next\"&gt;<br \/>\n&lt;!\u2013 previous_post_link \u2013&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;?php } \/\/ End if-else statement ?&gt;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;\/div&gt;<br \/>\n&nbsp; &nbsp; &lt;\/main&gt;<br \/>\n&nbsp; &nbsp; &lt;!-- .site-main --&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;script type=\"text\/javascript\"&gt;<br \/>\n&nbsp; &nbsp; $(function () {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; var oldClass = \"\";<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; var Obj = \"\";<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; $(\".bsy_timeline li\").hover(function () {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Obj = $(this).children(\".author_tou\");<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Obj = Obj.children(\"img\");<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oldClass = Obj.attr(\"class\");<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var newClass = oldClass + \" zhuan\";<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Obj.attr(\"class\", newClass);<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; }, function () {<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Obj.attr(\"class\", oldClass);<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; })<br \/>\n&nbsp; &nbsp; })<br \/>\n&lt;\/script&gt;<br \/>\n&lt;?php get_sidebar(); ?&gt;<br \/>\n&lt;?php get_footer(); ?&gt;\n<\/p>\n<div>\n\t\n<\/div>\n<p>\n\t\n<\/p>\n<p>\n\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u771ftm\u4e0d\u5bb9\u6613\u554a\uff0cwordpress\u5c0f\u767d\u5168\u662f\u6cea\u554a\uff0c\u5de5\u592b\u4e0d\u8d1f\u6709\u5fc3\u4eba &lt;?php&nbsp; \/* Templ &hellip; <a href=\"http:\/\/81.70.49.155\/?p=2173\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u641e\u5b9aWordPress\u4e2dwp_pagenavi\u5931\u6548\u95ee\u9898\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"views":690,"_links":{"self":[{"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/posts\/2173"}],"collection":[{"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/81.70.49.155\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2173"}],"version-history":[{"count":2,"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/posts\/2173\/revisions"}],"predecessor-version":[{"id":2532,"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/posts\/2173\/revisions\/2532"}],"wp:attachment":[{"href":"http:\/\/81.70.49.155\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/81.70.49.155\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2173"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/81.70.49.155\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}