百度
360搜索
搜狗搜索

在WordPress WooCommerce产品简短描述中增加表单调用详细介绍

没什么好说的,直接上代码:

  1. if (!function_exists('my_content')) {

  2. function my_content( $content ) {

  3. $content .= '<div><h2 style="color:#FF0000";>↓↓↓Please fill out the form below to get the latest quotation↓↓↓</h2>[wpforms id="1259"]</div>';

  4. return $content;

  5. }

  6. }

  7. add_filter('woocommerce_short_description', 'my_content', 10, 2);

需要自行替换 [wpforms id="1259"] 表单短代码,至于如何生成表单可以自己谷歌一下,这方面的教程很多。

使用方法:把上面的代码添加到主题 functions.php 文件中即可。

,

阅读更多 >>>  mysql怎么修改端口号

文章数据信息:

本文主要探讨:"在WordPress WooCommerce产品简短描述中增加表单调用", 浏览人数已经达到60次, 首屏加载时间:1.641 秒。