I'm trying to figure out how to do a if else statement in Wordpress. I want it to state if $data[0]['media_upload']
is empty then show the blog title. Else (if there is something there) show the logo in Wordpress. I'm wondering if I have the wrong syntax.
Right now I have the following which is showing the blog title and no errors but I do have a image uploaded and its not showing for some reason. Any ideas would be great!
<?php
if (empty($data[0]['media_upload'])) {
echo'<h1 class="site-title"><a href="';
esc_url( home_url( '/' ) );
echo'" title="';
esc_attr( get_bloginfo( 'name', 'display' ) );
echo'" rel="home">';
bloginfo( 'name' );
echo'</a></h1>';
}
else{
echo '<a href="';
bloginfo('siteurl');
echo '">';
echo'<img src="';
global $data;
$data['media_upload'];
echo'" /></a>';
}
?>