2017-09-16 126 views
1

我在這裏做了一些簡單的錯誤。任何人都可以幫忙嗎?if-statement與多個ifelse的語句難度

<?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

你缺少 '}' 上線7,前ELSEIF。 – Karkouch

回答

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 } ?> 
+0

我現在看到..我錯過了一個} –