{"id":608,"date":"2023-04-24T13:09:26","date_gmt":"2023-04-24T05:09:26","guid":{"rendered":"https:\/\/ciyuani.com\/?p=608"},"modified":"2023-04-24T13:09:26","modified_gmt":"2023-04-24T05:09:26","slug":"wordpress-%e4%b8%bb%e9%a2%98%e6%b7%bb%e5%8a%a0%e9%bc%a0%e6%a0%87%e8%b7%9f%e9%9a%8f%e7%89%b9%e6%95%88","status":"publish","type":"post","link":"https:\/\/ciyuani.com\/index.php\/2023\/04\/24\/wordpress-%e4%b8%bb%e9%a2%98%e6%b7%bb%e5%8a%a0%e9%bc%a0%e6%a0%87%e8%b7%9f%e9%9a%8f%e7%89%b9%e6%95%88\/","title":{"rendered":"WordPress \u4e3b\u9898\u6dfb\u52a0\u9f20\u6807\u8ddf\u968f\u7279\u6548"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u524d\u8a00<\/h2>\n\n\n\n<p>\u5206\u4eab\u4e2a\u9f20\u6807\u8ddf\u968f\u7279\u6548\uff0c\u7ed9\u559c\u6b22\u82b1\u82b1\u8349\u8349\u7684\u670b\u53cb\u4eec\u3002\u8fd9\u4e2a\u9f20\u6807\u8ddf\u968f\u7279\u6548\u8fd8\u662f\u5f88\u9177\u7684\uff0c\u4e0d\u662f\u90a3\u79cd\u9f20\u6807\u540e\u9762\u8ddf\u968f\u4e00\u5927\u5806\u96f6\u96f6\u788e\u788e\u7684\uff0c\u4ec5\u4e00\u4e2a\u5706\u5708\u8ddf\u968f\u9f20\u6807\u6307\u9488\uff0c\u5f53\u9047\u5230\u8d85\u94fe\u63a5\u5706\u5708\u4f1a\u53d8\u6210\u534a\u900f\u660e\u7684\u80cc\u666f\uff0c\u56fd\u5916\u7f51\u7ad9\u5e38\u89c1\u7684\u4e00\u79cd\u7279\u6548\uff0c\u5177\u4f53\u6548\u679c\u770b\u672c\u7ad9\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u6dfb\u52a0\u65b9\u6cd5\u975e\u5e38\u7b80\u5355\uff0c\u5c06\u4e0b\u9762\u4ee3\u7801\u6dfb\u52a0\u5230\u4e3b\u9898\u51fd\u6570\u6a21\u677ffunctions.php\u6700\u540e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u52a0\u8f7djquery\u5f00\u59cb\uff0c\u5982\u679c\u4e3b\u9898\u5df2\u52a0\u8f7d\u4e0d\u52a0\u8fd9\u6bb5\u3002\r\nfunction zm_jquery_script() {\r\n\twp_enqueue_script( 'jquery' );\r\n}\r\nadd_action( 'wp_enqueue_scripts', 'zm_jquery_script' );\r\n\/\/ \u52a0\u8f7djquery\u7ed3\u675f\r\nfunction zm_mouse_cursor() { ?>\r\n&lt;!-- \u5fc5\u987b\u7684DIV -->\r\n&lt;div class=\"mouse-cursor cursor-outer\">&lt;\/div>\r\n&lt;div class=\"mouse-cursor cursor-inner\">&lt;\/div>\r\n&lt;!-- JS\u811a\u672c -->\r\n&lt;script>\r\njQuery(document).ready(function($){\r\n\tvar myCursor = jQuery('.mouse-cursor');\r\n\tif (myCursor.length) {\r\n\t\tif ($('body')) {\r\n\t\t\tconst e = document.querySelector('.cursor-inner'),\r\n\t\t\tt = document.querySelector('.cursor-outer');\r\n\t\t\tlet n,\r\n\t\t\ti = 0,\r\n\t\t\to = !1;\r\n\t\t\twindow.onmousemove = function(s) {\r\n\t\t\t\to || (t.style.transform = \"translate(\" + s.clientX + \"px, \" + s.clientY + \"px)\"),\r\n\t\t\t\te.style.transform = \"translate(\" + s.clientX + \"px, \" + s.clientY + \"px)\",\r\n\t\t\t\tn = s.clientY,\r\n\t\t\t\ti = s.clientX\r\n\t\t\t},\r\n\t\t\t$('body').on(\"mouseenter\", \"a, .cursor-pointer\",\r\n\t\t\tfunction() {\r\n\t\t\t\te.classList.add('cursor-hover'),\r\n\t\t\t\tt.classList.add('cursor-hover')\r\n\t\t\t}),\r\n\t\t\t$('body').on(\"mouseleave\", \"a, .cursor-pointer\",\r\n\t\t\tfunction() {\r\n\t\t\t\t$(this).is(\"a\") &amp;&amp; $(this).closest(\".cursor-pointer\").length || (e.classList.remove('cursor-hover'), t.classList.remove('cursor-hover'))\r\n\t\t\t}),\r\n\t\t\te.style.visibility = \"visible\",\r\n\t\t\tt.style.visibility = \"visible\"\r\n\t\t}\r\n\t}\r\n})\r\n \r\n&lt;\/script>\r\n&lt;!-- \u6837\u5f0f -->\r\n&lt;style>\r\n.mouse-cursor {\r\n\tposition: fixed;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tpointer-events: none;\r\n\tborder-radius: 50%;\r\n\t-webkit-transform: translateZ(0);\r\n\ttransform: translateZ(0);\r\n\tvisibility: hidden\r\n}\r\n \r\n.cursor-inner {\r\n\tmargin-left: -3px;\r\n\tmargin-top: -3px;\r\n\twidth: 6px;\r\n\theight: 6px;\r\n\tz-index: 10000001;\r\n\tbackground: #ffa9a4;\r\n\t-webkit-transition: width .3s ease-in-out,height .3s ease-in-out,margin .3s ease-in-out,opacity .3s ease-in-out;\r\n\ttransition: width .3s ease-in-out,height .3s ease-in-out,margin .3s ease-in-out,opacity .3s ease-in-out\r\n}\r\n \r\n.cursor-inner.cursor-hover {\r\n\tmargin-left: -18px;\r\n\tmargin-top: -18px;\r\n\twidth: 36px;\r\n\theight: 36px;\r\n\tbackground: #ffa9a4;\r\n\topacity: .3\r\n}\r\n \r\n.cursor-outer {\r\n\tmargin-left: -15px;\r\n\tmargin-top: -15px;\r\n\twidth: 30px;\r\n\theight: 30px;\r\n\tborder: 2px solid #ffa9a4;\r\n\t-webkit-box-sizing: border-box;\r\n\tbox-sizing: border-box;\r\n\tz-index: 10000000;\r\n\topacity: .5;\r\n\t-webkit-transition: all .08s ease-out;\r\n\ttransition: all .08s ease-out\r\n}\r\n \r\n.cursor-outer.cursor-hover {\r\n\topacity: 0\r\n}\r\n \r\n.main-wrapper&#91;data-magic-cursor=hide] .mouse-cursor {\r\n\tdisplay: none;\r\n\topacity: 0;\r\n\tvisibility: hidden;\r\n\tposition: absolute;\r\n\tz-index: -1111\r\n}\r\n&lt;\/style>\r\n&lt;?php }\r\nadd_action( 'wp_footer', 'zm_mouse_cursor' );<\/code><\/pre>\n\n\n\n<p>\u4ee3\u7801\u5728\u672c\u7ad9\u6d4b\u8bd5\u6210\u529f\uff0c\u795d\u541b\u597d\u8fd0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u5206\u4eab\u4e2a\u9f20\u6807\u8ddf\u968f\u7279\u6548\uff0c\u7ed9\u559c\u6b22\u82b1\u82b1\u8349\u8349\u7684\u670b\u53cb\u4eec\u3002\u8fd9\u4e2a\u9f20\u6807\u8ddf\u968f\u7279\u6548\u8fd8\u662f\u5f88\u9177\u7684\uff0c\u4e0d\u662f\u90a3\u79cd\u9f20\u6807\u540e\u9762\u8ddf\u968f\u4e00\u5927\u5806\u96f6\u96f6\u788e\u788e\u7684\uff0c\u4ec5\u4e00\u4e2a\u5706\u5708\u8ddf\u968f &#8230;<\/p>\n","protected":false},"author":1,"featured_media":610,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[3],"tags":[6,33,64,24],"class_list":["post-608","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-daogu","tag-wordpress","tag-33","tag-64","tag-24"],"_links":{"self":[{"href":"https:\/\/ciyuani.com\/index.php\/wp-json\/wp\/v2\/posts\/608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ciyuani.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ciyuani.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ciyuani.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ciyuani.com\/index.php\/wp-json\/wp\/v2\/comments?post=608"}],"version-history":[{"count":1,"href":"https:\/\/ciyuani.com\/index.php\/wp-json\/wp\/v2\/posts\/608\/revisions"}],"predecessor-version":[{"id":609,"href":"https:\/\/ciyuani.com\/index.php\/wp-json\/wp\/v2\/posts\/608\/revisions\/609"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ciyuani.com\/index.php\/wp-json\/wp\/v2\/media\/610"}],"wp:attachment":[{"href":"https:\/\/ciyuani.com\/index.php\/wp-json\/wp\/v2\/media?parent=608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ciyuani.com\/index.php\/wp-json\/wp\/v2\/categories?post=608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ciyuani.com\/index.php\/wp-json\/wp\/v2\/tags?post=608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}