WordPress 使用 Code Snippets 管理代码片段

如果你喜欢折腾 WordPress,肯定对 functions.php 再熟悉不过,你可以将自己的功能函数添加到这个文件,从而实现某些网站功能。但是这个 functions.php 是及其敏感的,如果你代码有误或者保存文件的编码不对,很可能造成网站无法访问,具体的情况可以看一下 编辑WordPress主题的 functions.php 文件的注意事项

今天倡萌就推荐一个非常便于管理代码片段的插件 Code Snippets,只要是能添加到 functions.php 中的代码,都可以通过 Code Snippets 进行添加。Code Snippets 的优势在于:不必编辑主题的 functions.php 就可以很方便地添加代码,即使你更换主题,也不必重新添加;每一个代码片段都可以独立设置是否启用;代码添加和编辑页面支持代码高亮;支持导出导出代码片段……

code-snippets-1

 

code-snippets-2

在后台插件安装界面搜索 Code Snippets 即可在线安装,或者在此下载

来源:

https://www.wpdaxue.com/code-snippets.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_32404.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?