I'm trying to create a conditional statement to change the href of my header logo according to a certain page number. For example, on page (29) I want the logo to direct to "facebook" and on all other pages I want it to direct to the "home page".
<div class="logo_container">
<span class="logo_helper"></span>
<?php
if( is_page(29) ) {
<a href="https://www.facebook.com">
<img src="<?php echo esc_attr( $logo ); ?>"
alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>"
id="logo"
data-height-percentage="<?php echo esc_attr( et_get_option( 'logo_height', '54' ) ); ?>" />
</a>
} else {
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<img src = "<? php echo esc_attr ($ logo);?>"
alt = "<? php echo esc_attr ( get_bloginfo ('name')); ?> "
id =" logo "
data-height-percentage =" <? php echo esc_attr (et_get_option ('logo_height', '54')); ?> "/>
</a>
}
?>
</div>
I get this error
(( ! ) Parse error: syntax error, unexpected '
<
' in I:\wamp\www\testnom\wp-content\themes\divi-child\header.php on line 244)