
{"id":1752,"date":"2020-08-05T12:28:23","date_gmt":"2020-08-05T04:28:23","guid":{"rendered":"http:\/\/admin.evshou.com\/?p=1752"},"modified":"2020-08-07T15:56:54","modified_gmt":"2020-08-07T07:56:54","slug":"wp%e6%95%99%e7%a8%8b%ef%bc%9a22%e3%80%81wordpress%e6%a8%a1%e6%9d%bf%e5%88%a4%e6%96%ad%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.9713job.com\/?p=1752","title":{"rendered":"wp\u6559\u7a0b\uff1a22\u3001WordPress\u6a21\u677f\u5224\u65ad\u51fd\u6570"},"content":{"rendered":"<h3>WordPress\u6a21\u677f\u5224\u65ad\u51fd\u6570<\/h3>\n<p>\u65b9\u6cd5\uff1a<\/p>\n<p>&lt;?php is_home(); ?&gt;\u00a0 \u662f\u5426\u5728\u9996\u9875<\/p>\n<p>&lt;?php wp_title(); ?&gt;\u00a0 \u81ea\u52a8\u8bc6\u522b\u6a21\u677f\uff0c\u8fd4\u56de\u5bf9\u5e94\u6807\u9898<\/p>\n<p>$paged\u00a0 \u5168\u5c40\u53d8\u91cf\uff0c\u5224\u65ad\u662f\u5426\u4e3a\u5206\u9875<\/p>\n<p>&lt;?php is_category(); ?&gt;\u00a0 \u662f\u5426\u5728\u5206\u7c7b\u9875<\/p>\n<p>&lt;?php is_search(); ?&gt;\u00a0 \u662f\u5426\u5728\u641c\u7d22\u9875<\/p>\n<p>&lt;?php is_404(); ?&gt;\u00a0 \u662f\u5426\u5728404\u9875<\/p>\n<p>&lt;?php is_single(); ?&gt;\u00a0 \u662f\u5426\u5728\u6587\u7ae0\u9875<\/p>\n<p>&lt;?php is_page(); ?&gt;\u00a0 \u662f\u5426\u5728\u72ec\u7acb\u9875\u9762<!--more--><\/p>\n<p>\u77e5\u8bc6\u70b9\uff1a<\/p>\n<p>1.\u5b66\u4f1a\u4f7f\u7528\u6a21\u677f\u5224\u65ad\u51fd\u6570\uff0c\u52a8\u6001\u751f\u6210\u6807\u9898<\/p>\n<p>&lt;?php is_home(); ?&gt;\u00a0 \u662f\u5426\u5728\u9996\u9875<\/p>\n<p>&lt;?php<br \/>\nif( is_home() ){ $title = get_bloginfo(&#8216;name&#8217;); }<br \/>\n?&gt;<br \/>\n&lt;title&gt;&lt;?php echo $title; ?&gt;&lt;\/title&gt;<\/p>\n<p>\u5728\u9996\u9875\u663e\u793a\u63cf\u8ff0<br \/>\n&lt;?php if( is_home() ){ ?&gt;<br \/>\n&lt;meta name=&#8221;description&#8221; content=&#8221;&lt;php bloginfo(&#8216;description&#8217;); ?&gt;&#8221; &gt;<br \/>\n&lt;?php } ?&gt;<\/p>\n<hr \/>\n<p>&lt;?php wp_title(); ?&gt;\u00a0 \u81ea\u52a8\u8bc6\u522b\u6a21\u677f\uff0c\u8fd4\u56de\u5bf9\u5e94\u6807\u9898<\/p>\n<p>&lt;?php<br \/>\nif( is_home() ){ $title = get_bloginfo(&#8216;name&#8217;); }<br \/>\nelse{ $title = wp_title(&#8221;,false).&#8221;_xx\u7684\u535a\u5ba2&#8221;; }<br \/>\n?&gt;<br \/>\n&lt;title&gt;&lt;?php echo $title; ?&gt;&lt;\/title&gt;<\/p>\n<hr \/>\n<p>$paged\u00a0 \u5168\u5c40\u53d8\u91cf\uff0c\u5224\u65ad\u662f\u5426\u4e3a\u5206\u9875<\/p>\n<p>&lt;?php<br \/>\nif( is_home() ){ $title = get_bloginfo(&#8216;name&#8217;); }<br \/>\nelse{ $title = wp_title(&#8221;,false).&#8221;_xx\u7684\u535a\u5ba2&#8221;; }<br \/>\nif( $paged &gt; 0){ $title .=&#8221;-\u7b2c&#8221; . $paged . &#8220;\u9875&#8221;;}<br \/>\n?&gt;<br \/>\n&lt;title&gt;&lt;?php echo $title; ?&gt;&lt;\/title&gt;<\/p>\n<hr \/>\n<p>2.\u901a\u8fc7\u6a21\u677f\u5224\u65ad\u51fd\u6570\uff0c\u52a8\u6001\u8c03\u7528css<\/p>\n<p>\u5224\u65ad\u5206\u7c7b\u9875\u8c03\u7528\u5206\u7c7b\u9875css<br \/>\n&lt;?php if( is_category() ){?&gt;&lt;link href=&#8221;&lt;?php bloginfo(&#8216;template_directory&#8217;)&#8217;?&gt;\/style-cat.css&#8221;&gt;&lt;? } ?&gt;<\/p>\n<p>\u5224\u65ad\u641c\u7d22\u9875\u8c03\u7528\u641c\u7d22\u9875css<br \/>\n&lt;?php if( is_search() ){?&gt;&lt;link href=&#8221;&lt;?php bloginfo(&#8216;template_directory&#8217;)&#8217;?&gt;\/style-search.css&#8221;&gt;&lt;? } ?&gt;<\/p>\n<p>\u5224\u65ad404\u9875\u8c03\u7528404\u9875css<br \/>\n&lt;?php if( is_404() ){?&gt;&lt;link href=&#8221;&lt;?php bloginfo(&#8216;template_directory&#8217;)&#8217;?&gt;\/style-404.css&#8221;&gt;&lt;? } ?&gt;<\/p>\n<p>\u5224\u65ad\u6587\u7ae0\u9875\u8c03\u7528\u6587\u7ae0\u9875css<br \/>\n&lt;?php if( is_single() ){?&gt;&lt;link href=&#8221;&lt;?php bloginfo(&#8216;template_directory&#8217;)&#8217;?&gt;\/style-404.css&#8221;&gt;&lt;? } ?&gt;<\/p>\n<p>\u5224\u65ad\u72ec\u7acb\u9875\u9762\u8c03\u7528\u72ec\u7acb\u9875css<br \/>\n&lt;?php if( is_page() ){?&gt;&lt;link href=&#8221;&lt;?php bloginfo(&#8216;template_directory&#8217;)&#8217;?&gt;\/style-page.css&#8221;&gt;&lt;? } ?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u6a21\u677f\u5224\u65ad\u51fd\u6570 \u65b9\u6cd5\uff1a &lt;?php is_home(); ?&gt;\u00a0 \u662f\u5426\u5728\u9996\u9875 &#038;l [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-1752","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts\/1752","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1752"}],"version-history":[{"count":4,"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts\/1752\/revisions"}],"predecessor-version":[{"id":1783,"href":"https:\/\/www.9713job.com\/index.php?rest_route=\/wp\/v2\/posts\/1752\/revisions\/1783"}],"wp:attachment":[{"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.9713job.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}