Sometimes you just want to change something really simple, or at least, it used to be really really simple, back in the old days where you just plopped your html into a file, renamed it php with a few bits of code, and called it your header.
If you want the latest greatest bells and whistles, you use a pre-built theme. I like this one called Avada. Used to be fairly easy to edit the header file.. you chose a header option, then found that file in the template directory, if you’re smart you copied it into your child theme, then edited it to your heart’s content.
Now they tell you to edit your theme using hooks and filters, and while I’ve had success with this to add content to some header areas, I wasn’t able to add WordPress php code without getting the White Screen of Death with a semi-helpful error message.
I wanted to use the good ol’ site title and slogan, which is entered into the general settings in WordPress on every WordPress site, instead of the logo. Why doesn’t Avada use this built in identity gem? No idea. While poking around the theme template files, I found a useful one called “logo.php.”
I created a copy of the logo.php file in a new folder in my child theme I named ‘templates’. In the Theme Options, I just removed the logo, poof, gone. No hiding it with css, no adding pseudo tags to write content…
In the logo.php file, find the beginning:
<div class=”fusion-logo” data-margin-top=”<?php echo Avada()->settings->get( ‘logo_margin’, ‘top’ ); ?>” data-margin-bottom=”<?php echo Avada()->settings->get( ‘logo_margin’, ‘bottom’ ); ?>” data-margin-left=”<?php echo Avada()->settings->get( ‘logo_margin’, ‘left’ ); ?>” data-margin-right=”<?php echo Avada()->settings->get( ‘logo_margin’, ‘right’ ); ?>”>
Right after it, add this:
<span id=”site-title”><a title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?></a></span><h4 class=”subtitle”><?php bloginfo(‘description’); ?></h4>
Now I didn’t use an H1 tag because it had margins around it that were difficult to overwrite with css. I added my own styles (id=”site-title” and class=”subtitle”) that I added to the child theme style sheet to control the size, spacing, color, hover setting, font, text-shadow, etc.
If you need help customizing your Avada theme, hit me up on my contact page!