我已经下载了Contact Form 7 要添加联系人表单,请在每篇帖子之后添加一个简单的片段,我已经在函数中添加了它。php如下所示:
//if post type I add a form
function is_post_type($type)
{
global $wp_query;
if($type == get_post_type($wp_query->post->ID)) return true;
return false;
}
function add_post_content($content){
if(!is_feed() && !is_home()&& is_single() && is_post_type(\'post\'))
{
$content .= \'[contact-form-7 id="2202" title="Formulario de contacto 1"]\';
}
return $content;
}
add_filter(\'the_content\', \'add_post_content\');
我现在想做的是在插件中添加一个新字段,以便在用户发送表单时发送条目的链接,或者甚至在电子邮件内容后连接此链接或Id,或者诸如此类的内容,但我被WordPress困住了,我不知道需要编辑什么文件以及如何导入$post变量。