我正在使用“地理定位IP检测”插件,以便为访问者提供本地化的亚马逊附属链接。
当我在自定义HTML块中输入类似的内容时:
[geoip_detect2_show_if country="MX"]
<div class="wp-block-buttons is-content-justification-center">
<!--wp:button {"backgroundColor":"luminous-vivid-
orange","textColor":"white","className":"is-style-fill"} -->
<div class="wp-block-button is-style-fill">
<a class="wp-block-button__link has-white-color has-luminous-
vivid-orange-background-color has-text-color has-background" href="https://amzn.to/example" target="_blank" rel="noreferrer noopener nofollow">See on Amazon</a>
</div>
<!-- /wp:button -->
</div>
[/geoip_detect2_show_if]当我回到编辑器时,我在我的自定义HTML块中得到了这样的信息:
[geoip_detect2_show_if country="MX"]
<div class="wp-block-buttons is-content-justification-center"></div>
[/geoip_detect2_show_if]在编辑器中删除链接。这些块看起来工作正常(提供本地化链接),但是如果我再次保存页面,没有链接的代码将被更新到页面中。
发布于 2021-12-17 01:04:43
看来你在用古腾堡的编辑器。尝试在自定义html块之前和之后使用专用的短代码块来构建布局。因此,geoip_detect2_show_if country="MX“位于顶部的短代码块中,您的自定义html是在自定义html块中使用的(如果不需要,请移除注释项),然后在一个短代码块中使用/geoip_detect2_show_if。
https://stackoverflow.com/questions/70384771
复制相似问题