在WordPress WooCommerce产品简短描述中增加表单调用
在WordPress WooCommerce产品简短描述中增加表单调用详细介绍
没什么好说的,直接上代码:
-
if (!function_exists('my_content')) { -
function my_content( $content ) { -
$content .= '<div><h2 style="color:#FF0000";>↓↓↓Please fill out the form below to get the latest quotation↓↓↓</h2>[wpforms id="1259"]</div>'; -
return $content; -
} -
} -
add_filter('woocommerce_short_description', 'my_content', 10, 2);
需要自行替换 [wpforms id="1259"] 表单短代码,至于如何生成表单可以自己谷歌一下,这方面的教程很多。
使用方法:把上面的代码添加到主题 functions.php 文件中即可。
,