I'm trying to set up a new site, using the Hemingway theme. I want to add a logo to the header. The theme editor wants me to use the admin panel to upload the logo. There are two problems with this. First, that method is bound to fail, because of course WordPress doesn't have write access to the filesystem and I'm not about to grant it such access. Second, the normal way to post such things on a website is to upload the relevant files to the server in the proper location and link to them. But where does the logo go?
In my theme, the logo is placed by the following code:
<?php if ( get_theme_mod( 'hemingway_logo' ) ) : ?>
<div class='blog-logo'>
<a href='<?php echo esc_url( home_url( '/' ) ); ?>' title='<?php echo esc_attr( get_bloginfo( 'title' ) ); ?> — <?php echo esc_attr( get_bloginfo( 'description' ) ); ?>' rel='home'>
<img src='<?php echo esc_url( get_theme_mod( 'hemingway_logo' ) ); ?>' alt='<?php echo esc_attr( get_bloginfo( 'title' ) ); ?>'>
</a>
</div> <!-- /blog-logo -->
The way I see it, I have two options:
- Modify the code and hard code my logo here. The problem here is that the more I modify the code, the more maintainability issues I can expect to encounter.
- Figure out where this code expects a logo. It appears that the function
get_theme_mod
is the key, but when I looked up its definition, it appears that there's quite a tangle of code to follow (and I've never heard of an interactive debugger for PHP).
Of these options, I think that number 2 is quite preferable, but I don't understand the code sufficiently to do it.
What recommendest thou?