我在做一些简单的错误。任何人都可以快速帮忙吗?
<?php
global $wp_query;
$postid = $wp_query->post->ID;
$Property_Type = get_post_meta($postid, 'Property_Type', true);
if ($Property_Type == 'Residential') { ?>
Single Family
<?php
elseif ($Property_Type == 'Business Opportunity') { ?>
Biz Opp <?php }
else { ?>
<?php echo c2c_get_custom('Property_Type'); ?>
<?php } ?>
答案 0 :(得分:1)
我不确定我做错了什么,但下面有效
<?php
global $wp_query;
$postid = $wp_query->post->ID;
$Property_Type = get_post_meta($postid, 'Property_Type', true);
if ($Property_Type == 'Residential') { ?>
Single Family
<?php } elseif ($Property_Type == 'Business Opportunity') { ?>
Biz Opp
<?php echo c2c_get_custom('Property_Type'); ?>
<?php } ?>