Help me. How do I get the logo?
-
Hi,
I need a little help here:
Here is the situation: I’m building a WP theme and I want to check if there is a logo.png file. If this file exists, so show it. If not, display the bloginfo () function.
So far I try something like this, but it’s not working:
[code]
<?php
$file = get_bloginfo('stylesheet_directory') . "/images/logo.png";
if ($file !== FALSE) { ?>
<img src="<?php bloginfo('template_directory'); ?>/images/logo.png" alt="Logo" />
<?php } else { ?>
<h1>/"><?php bloginfo('name'); ?></h1>
<h2><?php bloginfo('description'); ?></h2>
<?php } ?>
[/code]Thanks in advance,
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Help me. How do I get the logo?’ is closed to new replies.