WordPress标题和页脚
我正在使用自定义WordPress主题工作,但想知道WordPress如何决定应在页脚中添加哪个链接或脚本,或者应该在标题中添加哪个脚本,因为我们在functions.php中添加了所有链接,而无需提及它需要在哪里额外。
如果有人能解释会很棒!
I'm working in custom wordpress theme but wondering how wordpress decides to which link or script should be added in footer or which script should be added in header because we add all the links in the functions.php without mentioning that where it needs to be added.
Would be great if anyone could explain!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们通常使用
wp_enqueue_script
功能,以包括任何脚本或样式的文件。在此功能中,您可以看到允许很少的参数。您可以看到最后一个参数US
$ in_footer
,如果需要将脚本/样式加载到页脚中,则可以将其设置为TRUE。默认情况下,它是错误的,并在< head>
区域中加载。有关更多详细信息,您可以阅读官方信息在这里。
We usually use the
wp_enqueue_script
function for including any script or style's file. In this function you can see there are few parameters are allowed.You can see the last parameter us
$in_footer
, you can set it true if you need to load the script/style in the footer. By default it is false and load in the<head>
area.For more details you can read the official information here.