dimanche 3 janvier 2016

Wordpress IF statement isn't working

Really pulling my hair out of over this one, must be a slow day at the office.

I have a straight forward IF statement to evaluate whether or not a an image is set to appear as the logo on a wordpress build. IF it returns empty/false, it displays a default image whose location is set as an absolute value.

I'm sure this is one of those silly mistakes that will have me kicking myself, but just thought I'd see if anyone could help before I waste any more time!

           <?php 
            $logo = $wp_options['header_logo'];

            if(isset($logo) && ($logo !='')) { ?>
                <img src="<?php echo $logo['url']; ?>">
            <?php  } else {  ?>
                <img src="wp-content/themes/wpdev/images/logo.png">
            <?php } ;?>

Aucun commentaire:

Enregistrer un commentaire