wordpress wordpress-theming custom-wordpress-pages wordpress-thesis-theme
<?php
if (isset($_POST['sbt'])) {
//user posted variables
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
//php mailer variables
$to = get_option('aaaa@gmail.com');
$subject = "Report";
$headers = 'From: '. $email . "\r\n" .
'Reply-To: ' . $email . "\r\n";
echo "check";
//Here put your Validation and send mail
$sent = wp_mail($to, $subject, strip_tags($message), $headers);
if($sent) {
echo "sent";
}//mail sent!
else {
echo "failed";
}//message wasn't sent
}
?>Run Code Online (Sandbox Code Playgroud)
我已经开发了自己的文字出版网站,我需要在联系表单中使用WP_mail()函数。
请帮我。
wordpress wordpress-theming custom-wordpress-pages wordpress-thesis-theme
简单的Wordpress问题 - get_post_meta没有检索自定义字段值.这是从自定义字段中提取的代码:
<img src="<?php echo FCG_PLUGIN_URL; ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, 'slider_image', true); ?>&h=250&w=400&zc=1" alt="<?php echo $post_title; ?>" />
Run Code Online (Sandbox Code Playgroud)
在制作中,这是我得到的HTML:
<img alt="Post Title" src="http://***.com/wp-content/plugins/jquery-slider-for-featured-content/scripts/timthumb.php?src=/&h=50&w=80&zc=1">
Run Code Online (Sandbox Code Playgroud)
你可以看到字符串中的src = point是空的 - 好像没有任何帖子从中发布.我已经隔离并回显了get_post_meta,它是一个空格.我100%肯定它在帖子中的名字是正确的 - 有什么东西在我这里丢失吗?