We know a lot about Moodle themes so that you don't have to.
Whenever I add a custom logo to a Moodle theme, I always try to leave the H1 tag and headings in the HTML for search engines and screen readers to find. And, since this isn't the method described in the Moodle Documentation, I thought it was time I shared my method in the name of accessibility and search engine optimization.
What follows was pulled from header.html in the Standard theme folder on version 1.9:
<?php print_container_start(true, '', 'header-home'); ?>
<h1 class="headermain"><?php echo $heading ?></h1>
<div class="headermenu"><?php echo $menu ?></div>
<?php print_container_end(); ?>
In the above, <?php echo $heading ?> is your site title. The easiest way to add a logo would be to replace this code with something like <img src="image.jpg" />, save and be done with it. However, this would essentially leave your site nameless since screen readers and search engines can't read your image.
Luckily, there is another way.
<h1 class="headermain"><?php echo $heading ?></h1>
<div class="headermenu"><?php echo $menu ?></div>
This will appear twice. The first sets what will appear on your front page only (designated by 'header-home'). The second sets what will appear on all other pages where the header is used (designated by 'header'). If you want your logo to appear on ALL pages, you will simply have to add it twice, in both places.
<h1 class="headermain"><?php echo $heading ?></h1>
<img class="logo" src="<?php echo $CFG->themewww ."/". current_theme() ?>/pix/logo.jpg" />
<div class="headermenu"><?php echo $menu ?></div>
And, that's it for the HTML. Now, let's use CSS to hide your site title from viewers while retaining it in the HTML.
#header-home .headermain {
position:absolute:
left:-9999px;
}
#header-home .logo {
float:left;
}
And, if you are adding a logo to all pages (and you have made the appropriate additions to both places in header.html noted above), your addition will look like this:
#header-home .headermain,
#header .headermain {
positiion:absolute:
left:-9999px;
}
#header-home .logo,
#header .logo {
float:left;
}
header-home .logo {
float:left;
padding:Wpx Xpx Ypx Zpx;
}
In the above example W="top", X="right", Y="bottom", and Z="left".
Please feel free to post any questions you have in our forums.