Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
<?php if( $settings['logo']) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php echo $settings['logo']; ?>"/></a>

<?php else if ( $settings['logo_option'] == 'image' && !$settings['logo'] ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php bloginfo('template_directory');?>/images/logo.png"/></a>

<?php else if( $settings['logo_option'] == 'text' && !$settings['logo'] ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>

<?php else : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>

<?php endif; ?>
share|improve this question

closed as too localized by s_ha_dum, brasofilo, toscho Jan 7 '13 at 21:47

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
What is happening that shouldn't be? Or visa-versa? –  s_ha_dum Jan 7 '13 at 19:03
    
Parse error: syntax error, unexpected T_IF, expecting ':' –  Jessica Jan 7 '13 at 19:05
    
error on the first else if statement I guess –  Jessica Jan 7 '13 at 19:06

1 Answer 1

up vote 2 down vote accepted

Remove the spaces in your else ifs such that they become elseifs. PHP interprets else if as though it were an if conditional nested within an else, and as such is expecting the else : to match your if : when it encounters else{ if(){} } instead. See 4661508 and 3385213 for more precise details :)

share|improve this answer
    
That works perfectly, thank you. I didn't know that about these kinds of statements. –  Jessica Jan 7 '13 at 19:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.