{"id":4502,"date":"2022-10-10T15:45:57","date_gmt":"2022-10-10T07:45:57","guid":{"rendered":"http:\/\/101.37.83.176\/?p=4502"},"modified":"2022-10-10T15:58:04","modified_gmt":"2022-10-10T07:58:04","slug":"modifying-a-theme-template","status":"publish","type":"post","link":"http:\/\/101.37.83.176\/?p=4502","title":{"rendered":"\u7f51\u7ad9\u5347\u7ea7\u4e3b\u9898\u7248\u672c\u65f6\u9700\u8981\u4fee\u6539\u7684\u5185\u5bb9"},"content":{"rendered":"<p><strong>1\u3001\u4fee\u6539\u811a\u6ce8\u4e0a\u7684Powered by WordPress\u4e3a\u5907\u6848\u4fe1\u606f<\/strong><br \/>\n\/**<br \/>\n*\u5728footer.php\u4e2d\u627e\u5230 <?php do_action( 'twentytwelve_credits' ); ?>\uff0c\u5e76\u66ff\u6362\u4e0b\u9762\u7684<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&lt;a href=&quot;&lt;?php echo esc_url( __( 'https:\/\/wordpress.org\/', 'twentytwelve' ) ); ?&gt;&quot; class=&quot;imprint&quot; title=&quot;&lt;?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentytwelve' ); ?&gt;&quot;&gt;\r\n&lt;?php\r\n\/* translators: %s: WordPress *\/\r\nprintf( __( 'Proudly powered by %s', 'twentytwelve' ), 'WordPress' );\r\n?&gt;\r\n&lt;\/a&gt;\r\n<\/pre>\n<p>\u4e3a\uff1a*\/<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&lt;?php _e(&quot;Copyright&quot;, '101kPa'); ?&gt; &amp;copy; 2011-&lt;?php echo date('Y'); ?&gt; &amp;middot; &lt;?php _e(&quot;All Rights Reserved&quot;, '101kPa'); ?&gt; &amp;middot; &lt;?php _e(&quot;101kPa.com by&quot;, '101kPa'); ?&gt; &lt;a href=&quot; http:\/\/101.37.83.176\/?page_id=2&quot;&gt;J.Y. WANG&lt;\/a&gt;&lt;br \/&gt;\r\n&lt;a href=&quot;https:\/\/beian.miit.gov.cn\/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;\u4eacICP\u590710041129\u53f7&lt;\/a&gt;&lt;strong&gt; | &lt;\/strong&gt;&lt;a href=&quot;http:\/\/www.beian.gov.cn&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;\u4eac\u516c\u7f51\u5b89\u590711010802012744\u53f7&lt;\/a&gt;\r\n<\/pre>\n<hr \/>\n<p><strong>2\u3001\u4fee\u6539\u7ffb\u9875\u63d2\u4ef6<\/strong><br \/>\n\/**<br \/>\n*\u5728functions.php\u4e2d\u90e8\u627e\u5230\u4e0b\u9762\u7684\u5185\u5bb9\uff0c\u5e76\u66ff\u6362<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&lt;div class=&quot;nav-previous&quot;&gt;&lt;?php next_posts_link( __( '&lt;span class=&quot;meta-nav&quot;&gt;&amp;larr;&lt;\/span&gt; Older posts', 'twentyten' ) ); ?&gt;&lt;\/div&gt;\r\n&lt;div class=&quot;nav-next&quot;&gt;&lt;?php previous_posts_link( __( 'Newer posts &lt;span class=&quot;meta-nav&quot;&gt;&amp;rarr;&lt;\/span&gt;', 'twentyten' ) ); ?&gt;&lt;\/div&gt;\r\n<\/pre>\n<p>\u4e3a\uff1a*\/<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&lt;?php wp_pagenavi(); ?&gt;\r\n<\/pre>\n<hr \/>\n<p><strong>3\u3001\u66ff\u6362Gravatar\u5934\u50cf\u4e3aCravatar\u5934\u50cf<\/strong><br \/>\n\/**<br \/>\n\u7531\u4e8eGravatar\u5168\u7403\u901a\u7528\u5934\u50cf\u88ab\u5899\uff0c\u4f1a\u5f71\u54cd\u7f51\u9875\u901f\u5ea6\u3002\u5c06\u66ff\u6362Gravatar\u5934\u50cf\u4e3aCravatar\u5934\u50cf\u3002<br \/>\n*\u5728functions.php\u5c3e\u90e8\u6dfb\u52a0\u4e0b\u9762\u7684\u51fd\u6570<br \/>\n*\/<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nif ( ! function_exists( 'get_cravatar_url' ) ) {\r\n    function get_cravatar_url( $url ) {\r\n        $sources = array(\r\n            'www.gravatar.com',\r\n            '0.gravatar.com',\r\n            '1.gravatar.com',\r\n            '2.gravatar.com',\r\n            'secure.gravatar.com',\r\n            'cn.gravatar.com'\r\n        );\r\n        return str_replace( $sources, 'cravatar.cn', $url );\r\n    }\r\n    add_filter( 'um_user_avatar_url_filter', 'get_cravatar_url', 1 );\r\n    add_filter( 'bp_gravatar_url', 'get_cravatar_url', 1 );\r\n    add_filter( 'get_avatar_url', 'get_cravatar_url', 1 );\r\n}\r\n<\/pre>\n<hr \/>\n<p><strong>4\u3001\u4e0d\u663e\u793a\u535a\u5ba2\u9875\u548c\u5355\u5185\u5bb9\u9875\u7684\u7279\u8272\u56fe\u50cf<\/strong><br \/>\n\/**<br \/>\n*\u5982\u679c\u5728\u5e16\u5b50\u4e2d\u8bbe\u7f6e\u4e86\u7279\u8272\u56fe\u7247\uff0cWordPress\u4e3b\u9898\u4f1a\u5728\u5355\u5185\u5bb9\u9875\u7684\u9876\u90e8\u548c\u535a\u5ba2\u9875\uff08\u6587\u7ae0\u9875\uff09\u663e\u793a\u4e00\u4e2a\u5927\u7684\u7279\u8272\u56fe\u7247\u3002<br \/>\n*\u4e3a\u4e0d\u663e\u793a\u535a\u5ba2\u9875\u548c\u5355\u5185\u5bb9\u9875\u7684\u7279\u8272\u56fe\u50cf\uff0c\u9700\u8981\u5c06content.php\u6587\u4ef6\u4e2d\u7b2c20\u884c-24\u884c\u6ce8\u91ca\u6389\uff0c\u5982\u4e0b\uff1a<br \/>\n*\/<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n# if ( ! post_password_required() &amp;&amp; ! is_attachment() ) :\r\n# the_post_thumbnail();\r\n# endif;\r\n?&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7f51\u7ad9\u5347\u7ea7\u4e3b\u9898\u7248\u672c\u65f6\u9700\u8981\u4fee\u6539\u7684\u5185\u5bb9<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[71],"tags":[74,239,316],"class_list":["post-4502","post","type-post","status-publish","format-standard","hentry","category-lamp","tag-lamp","tag-wordpress","tag-316"],"_links":{"self":[{"href":"http:\/\/101.37.83.176\/index.php?rest_route=\/wp\/v2\/posts\/4502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/101.37.83.176\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/101.37.83.176\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/101.37.83.176\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/101.37.83.176\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4502"}],"version-history":[{"count":0,"href":"http:\/\/101.37.83.176\/index.php?rest_route=\/wp\/v2\/posts\/4502\/revisions"}],"wp:attachment":[{"href":"http:\/\/101.37.83.176\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/101.37.83.176\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4502"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/101.37.83.176\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}