Correct Mystique Site Title Header
How to Correct WordPress Mystique Theme Site Title Header Markup
A sharp eyed user of the WordPress Mystique theme noticed duplicate <h1> headers on the front page.
The theme places the site title and tagline inside <h1> markup for the front page and blog page.
And of course, WordPress puts the page title in <h1> markup as well – so you get 2 instances of <h1> on the site front page and the blog.
Not good for SEO. There must only be one H1 on any page.
Funny thing is, the developer has commented the theme file responsible for assigning the title markup, in the code just prior to the offending lines of script:
“only on the front/home page, for seo reasons”
Change the Code to Fix Error
There are 2 files to modify. First is mystique/atom-core.php
Around line 1571 to 1573 where you find
// <h1> only on the front/home page, for seo reasons – CHANGED to H3
$tag = (is_home() || is_front_page()) ? 'h1' : 'div';
Change this to
$tag = (is_home() || is_front_page()) ? 'h3' : 'div';
To maintain consistency, also change the following in mystique/atom-hooks.php (around line 1522)
<h1 id="logo"><img alt="WordPress" src="<?php echo admin_url(); ?>/images/wordpress-logo.png" /></h1>
<h3 id="logo"><img alt="WordPress" src="<?php echo admin_url(); ?>/images/wordpress-logo.png" /></h3>
You can use other values as well to fix the Mystique <h1> error.
You don’t have to use <h3>. Use any h value you want, as long as it’s not H1. Lower-order h3 or even h4, 5 or 6 is better.
You could even just use paragraph markup <p>.
You could instead create a new custom page template for blog and front pages, changing Page Title markup in the template to <h2>. Then leave the site title in the h1 tag.
But I think it’s a lot easier and quicker to mod the theme core file mentioned.
It’s Not an Uncommon Theme fault.
We see this error with a lot of WordPress (and other) themes, including expensive commercial themes. Come on theme coders – the rules of HTML markup are simple – there must only ever be one instance of <h1> on any page – including the website front page and/or blog.
More Articles about Mystique WordPress Theme
- Error Message Using Mystique Theme
- NextGEN Gallery with Theme Mystique
- Mystique Unicorn Pictures in WordPress Dashboard