如何在wordpress网站上显示传单地图?

How to display a leaflet map on a wordpress website?

我在 codepen 上完成了传单地图。 我的代码分为 html/css 和 javascript/jquery。 我想知道如何在 wordpress 网站上显示地图。 我曾尝试在 codepen 上嵌入,但事实是“'Result on top left'”和“'edit on Codepen'”不符合我的需求。 我是否必须在完整的 html 中编写代码(然后我的 javascript 在 脚本中)? 有没有简单的方法来显示它? 非常感谢

我使用以下解决方案,它也适用于 Elementor。 是的,请使用 html,但是,在

中添加 css 和 js 文件

wp-content > themes > child-theme > assets > css or js folders

link these files as you would in a standard html setting, either by typing up the whole permalink or in a shortened ../wp-content/etc. link. I use the first option.

添加你的 html 应该可以。

提示 1:在您的浏览器中,检查是否有任何错误,因为如果您有任何旧的 javascript,WordPress 将发出警告。

提示 2:如果您使用任何图片,您需要像 WordPress Media 那样优化图片。