我正试图让接触表7的条件字段在WordPress中运行。我正在使用联系人表单7版本5.1.3和联系人表7条件字段版本1.9.14。
我试图遵循本教程,它给出了粘贴到Contact表单7表单选项卡中的最终代码:
Your name: [text your-name]
Your email address: [email* your-email]
<p>What kind of support do you want?
[select* support-type first_as_label "-- Choose support type --" "Technical support" "Sales"]</p>
[group technical-support-selected]
<p>Your operating system: [select* operating-system first_as_label "-- Choose your operating system --" "Android" "iOS" "Linux" "Windows" "Other"]</p>
[group os-selected]
<p>Please specify your [group os-android inline]Android[/group][group os-iOS inline]iOS[/group][group os-linux inline]Linux[/group][group os-windows inline]Windows[/group] version:
[text* version]</p>
[/group]
[group os-other-selected]
<p>Please specify your OS and version.
[text* other-os "Operating System"][text* other-version "Version"]</p>
[/group]
[/group]
[group sales-support-selected]
<p>Where is your business located?
[select* continent first_as_label "-- Choose your continent --" "Europe" "America" "Africa" "Asia" "Oceania" "Antarctica"]</p>
[/group]
<p>[textarea comments]</p>
[submit "Send"]
并将此代码粘贴到文本视图中的条件字段选项卡中:
show [technical-support-selected] if [support-type] equals "Technical support"
show [sales-support-selected] if [support-type] equals "Sales"
show [os-selected] if [operating-system] not equals ""
and if [operating-system] not equals "Other"
show [os-android] if [operating-system] equals "Android"
show [os-iOS] if [operating-system] equals "iOS"
show [os-linux] if [operating-system] equals "Linux"
show [os-windows] if [operating-system] equals "Windows"
show [os-other-selected] if [operating-system] equals "Other"
但是,当我粘贴代码时,最后的输出并没有隐藏任何东西,[/group]
将显示到输出中。这里有一个屏幕抓取:
知道我该怎么做吗?
发布于 2020-12-01 15:40:41
尝试将以下代码添加到functions.php
文件中,
add_filter( 'wpcf7_autop_or_not','__return_false');
将删除由<p></p>
插件为表单中的每一行添加的CF7包装标记。
https://wordpress.stackexchange.com/questions/378967
复制相似问题