在WordPress中将add_action()放在哪里

我是WordPress的新手。我指的是WordPress主题代码。我对将函数和该函数的add_action()放在哪里感到困惑。

我想知道在一个PHP文件中定义function和add_action并将其放在主题文件夹中的任何位置是否正确。


#1


” functions.php”是你要放置自定义函数, 挂钩和操作的文件。如果你的主题没有functions.php, 请创建它。 WordPress会自动获取其内容, 因此你可以在主题的任何位置访问定义的功能。

来源:

https://www.srcmini02.com/65931.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_40720.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?