【问题标题】:where to add the css and js files in the wordpress elementor pages在 wordpress elementor 页面中添加 css 和 js 文件的位置
【发布时间】:2018-11-30 11:02:34
【问题描述】:

我使用包含重定向到外部 css 和 js 文件的 HTML 的 elementor 页面创建。

例子

我的 elementor 页面有 "script src='script.js'""link rel='stylesheet' href='style.css'"

script.js 文件和style.css 文件放在哪里?

【问题讨论】:

    标签: php html css wordpress elementor


    【解决方案1】:

    在您的主题文件夹中创建一个类似“js”的目录并将脚本放入其中。在代码/模板中,路径看起来像

    <?php bloginfo('template_directory'); ?>/js/script.js
    

    【讨论】:

    • 但我在 Elementor 的 HTML 添加选项中添加了脚本源,它仍然算数吗?我的意思是它是由 elementor 创建的特定页面
    • 当您在主题的页脚(如“Elementor”或其他内容)中加载脚本时,它只会加载。
    猜你喜欢
    • 1970-01-01
    • 2012-12-26
    • 1970-01-01
    • 2014-06-28
    • 2020-09-21
    • 2021-11-29
    • 2023-02-19
    • 1970-01-01
    • 2019-04-15
    相关资源
    最近更新 更多