حالا اینم تست کنید شاید جواب داد.
<div class="logo">
<!--<img src="http://site.ir/wp-content/uploads/2016/10/logo.jpg" alt="" width="400" height="159">-->
<?php if(is_home() || is_front_page()) { ?>
<h1 class="logo"><a title="عنوان سایت" href="http://site.ir" >عنوان سایت</a></h1>
<?php } else { ?>
<h2 class="logo"><a title="عنوان سایت" href="http://site.ir" >عنوان سایت</a></h2>
<?php } ?>
</div>