php页面syntax error, unexpected 'elseif' 下面代码哪里怎么改,请指教

//create settings page
function wptimeline_settings() {
?>
<div class="wrap">
<h2><?php _e('Timeline Settings', WPTIMELINE_UNIQUE); ?></h2>
<div id="timeline_quick_links">
<?php /*include('inc/timeline_links.php'); */?>
</div>
<?php
if (isset($_GET['updated']) && $_GET['updated'] == 'true') {
?>
<div id="message" class="updated fade"><p><strong><?php _e('Settings Updated', WPTIMELINE_UNIQUE); ?></strong></p></div>
<?php
}
?>
<form method="post" action="<?php echo esc_url('options.php');?>">
<div>
<?php settings_fields('timeline-settings'); ?>
</div>

<?php
$options = timeline_set_options();

?>
<table class="form-table">
<?php foreach($options as $option){ ?>
<?php
//if option type is a dropdown, do this
if ( $option['input_type'] == 'dropdown'){ ?>
<tr valign="top">
<th scope="row"><?php _e($option['desc'], WPTIMELINE_UNIQUE); ?></th>
<td><select id="<?php echo $option['name']; ?>" name="<?php echo $option['name']; ?>">
<?php foreach($option['data'] as $opt => $value){ ?>
<option <?php if(get_option($option['name']) == $value){ echo 'selected="selected"';}?> name="<?php echo $option['name']; ?>" value="<?php echo $value; ?>"><?php echo $opt ; ?></option>
<? } //endforeach ?>
</select>
</td>
</tr>
<?php
//if option type is text, do this
}elseif ( $option['input_type'] == 'text'){ ?>
<tr valign="top">
<th scope="row"><?php _e($option['desc'], WPTIMELINE_UNIQUE); ?></th>
<td><input id="<?php echo $option['name']; ?>" name="<?php echo $option['name']; ?>" value="<?php echo get_option($option['name']); ?>" />
</td>
</tr>
<?php

}else{} //endif

} //endforeach ?>

</table>
<p class="submit"><input type="submit" class="button-primary" value="<?php _e('Update', WPTIMELINE_UNIQUE); ?>" /></p>
</form>
</div>
<?php
}

温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网