我正在从房地产网站导入字段。
导入一个自定义字段如下所示。。。
导入后的字段名称---->assistedLiving字段值---->false
要在wordpress中输出显示,我使用此。。。
<?php 
    global $wp_query;
    $postid = $wp_query->post->ID;
    if ($immopress_property[\'assistedLiving\']): ?>
        <li class="assistedLiving">
            <span class="attribute"  style="width:200px;display:block;float:left;"><?php echo \'Seniorengerechtes Wohnen\' ; ?><span class="wpp_colon">:</span></span>
            <span class="value"><?php echo get_post_meta($post->ID, \'assistedLiving\' , true); ?> </span>
        </li>
        <?php wp_reset_query(); ?>
    <?php endif; ?>  
 现场结果看起来很。。。
Seniorengerechtes Wohnen:false
我还试着。。。
    <?php          
    if ( get_post_meta($post->ID, \'assistedLiving\', true) ) { ?>
    <li class="assistedLiving">
      <span class="attribute"  style="width:200px;display:block;float:left;"><?php echo Seniorengerechtes Wohnen ; ?><span class="wpp_colon">:</span></span>
      <span class="value"><?php $assist=get_post_meta($post->ID, \'assistedLiving\' , true); if ($assist=="") echo "keine Daten"; else if(strtolower($assist)==\'true\') echo "Ja"; else if(strtolower($assist)==\'false\') echo "Nein"; ?> </span>
    </li>
    <?php wp_reset_query(); ?>
    <?php } ?> 
 但现场结果看起来很。。。
**Seniorengerechtes Wohnen:**
如何显示False/True值以显示Yes/No或德语Ja/NEIN?
显示所有字段的功能(用是/否正确显示):
function immopress_the_fields( $args ) {
    global $post, $ImmoPress;
    extract( wp_parse_args( $args, array (
        \'id\' => $post->ID,
        \'exclude\' => $exclude,
        \'echo\' => TRUE
    ) ), EXTR_SKIP );
    $fields = immopress_get_fields( $args );
    if ( !$fields ) 
        return false;
    $output = \'\';
    $output .= \'<ul class="immopress-fields">\';
    foreach ( $fields as $key => $value) {
        $entry = $ImmoPress->values[$value];
        if ( $entry == \'\') 
            $entry = $value;
        $output .= "<li class=\'immopress-field-$key\'>";
        $output .= "<strong class=\'immopress-key\'>{$ImmoPress->fields[$key]}: </strong>";
        $output .= "<span class=\'immopress-value\'>$entry</span>";
        $output .= "</li>"; 
    }
    $output .= \'</ul>\';
    if ( $echo ) {
        echo $output;
    } else {
        return $output;
    }
But i need to display only a view Custom Fields not all importet fields.
短代码的代码。。
function immopress_fields_shortcode( $atts ) {
    $args = wp_parse_args( $atts, array (
        \'echo\' => FALSE
    ) );
    return immopress_the_fields( $args );       
}
add_shortcode( \'immopress_fields\', \'immopress_fields_shortcode\' );