News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Missing H1 & H2

Started by ATX1976, September 30, 2014, 06:55:28 AM

Previous topic - Next topic

ATX1976

From what I understand, the H1 is supposed to be your forum's title, correct? Well, when I look at my forum using a heading analyzer tool, it shows that I have H1 & H2 tags, but there is no text; whereas, it shows multiple H3 tags with text. Any suggestions?

Arantor

The h1 is the forum title but your theme probably replaces it with an image.

For reasons I have never quite understood, the forum news is given an h2 prominence, with everything else being h3 and lower.

It is my understanding that the gap in hierarchy is not a problem provided that the ordering is correct.

ATX1976

Yes, the H1 tags appear within the image. <h1 class="forumtitle"> and the image URL has anchor text which is showing the forum title. I wonder why the heading analyzer tools show the H1 & H2 tags as blank?

Arantor

Because the h1 does not contain actual text. Image alt text doesn't count.

ATX1976

Quote from: Arantor on September 30, 2014, 09:08:25 AM
Because the h1 does not contain actual text. Image alt text doesn't count.

So do you suggest rewriting the code in the header to include the actual H1 text? Or is there a mod that will take care of this? 

Deaks

tbh its not really that important most of your users wont event notice, its really down to you if you want to redo it then on you go if not then great.

Their is no mod for it as its theme specific.
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

ATX1976

Quote from: TrayBake on September 30, 2014, 04:14:34 PM
tbh its not really that important most of your users wont event notice, its really down to you if you want to redo it then on you go if not then great.

Their is no mod for it as its theme specific.

Well, won't having the H1 take have an effect on the site's SEO?

Deaks

~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

ATX1976

It made a good read, but the fact is, SEO is a science. I've spent the last 4 years learning it and I still consider myself an amateur even though I have consistently ranked well for any keyword I've optimized for. Most of the SEO I dealt with involved Wordpress, so trying to optimize SMF has been a new challenge. I think SEO works best when you follow the tried and true methods, while experimenting with small changes on your site and recording the results of those changes.

And yes, I agree with the author of that article, a lot of self-proclaimed SEOs aren't qualified. Some do more damage than good. I hired one that literally ruined one of my sites and a few others who ripped me off. I'd had enough so I decided to learn SEO and I'm glad I did.

But back to my main question, does anyone have an example of a header which was modified to include the H1 text?

Arantor

How can it possibly be a science when the people who hold the science refuse to tell you how it works?

Antechinus

QuoteBut back to my main question, does anyone have an example of a header which was modified to include the H1 text?

You mean the forum name? Yeah, I did it for a custom theme. It's not hard to arrange.

<h1 id="forumtitle">
<a href="', $scripturl, '" id="forum_banner">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<span>'. $context['forum_name']. '</span><img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>


Obviously you can do other variations on the same idea.

Arantor

Then presumably some CSS to actually hide the text since you don't need text as well as the image?

Antechinus

Yup, if you like. I wanted both in that instance.

ATX1976

Quote from: Arantor on September 30, 2014, 06:31:14 PM
How can it possibly be a science when the people who hold the science refuse to tell you how it works?

Well, we weren't given an instruction manual on how to decode DNA either, but we're doing it aren't we?  ;) 

Arantor

Yes, but that's not my point.

It is very specifically in Google's interest NOT to tell you how to game their system because if it's figured out, the spammers will do it - and then they'll just change the system again.

ATX1976

Quote from: Arantor on September 30, 2014, 06:41:16 PM
Yes, but that's not my point.

It is very specifically in Google's interest NOT to tell you how to game their system because if it's figured out, the spammers will do it - and then they'll just change the system again.

I agree, but Google does release clues from time to time (knowingly and unknowingly) plus you can experiment with changes to see what works. I've figured out the basics. Good quality content, quality back links, regular content and social media updates, strategic interlinking, properly optimized titles and meta descriptions, etc.etc. Seems to work every time and it's all white hat.

Antechinus

All that is common knowledge though.

Arantor

The problem with experimenting with changes is that you're almost certainly confusing correlation with causation.

There are so many factors now involved in Google ranking that changing one thing on its own simply cannot be considered in isolation.

Unless you never add any content (remember: content gets you visitors), or make *any* other changes, you simply have no way to judge how effective any of them are.

Antechinus

That too. It's like the superstitious pigeon experiment.

ATX1976

Quote from: Antechinus on September 30, 2014, 06:53:34 PM
All that is common knowledge though.

True, but a lot of people still take short cuts. I find it humorous. I'll watch a site that has no reason to rank high jump into the top ten for a few days, then disappear from Google search results.

Quote from: Antechinus on September 30, 2014, 06:33:34 PM
<h1 id="forumtitle">
<a href="', $scripturl, '" id="forum_banner">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<span>'. $context['forum_name']. '</span><img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>
</h1>


I'm not much of a coder, can you explain what this is doing? Seems like there is a lot more going on than just H1. Also, could I copy and paste this onto my header and would everything work correctly?

Antechinus

Sure. What I did was change the PHP so that instead of calling either the forum name or the banner image (if one was available) it calls both if both are available.

What exactly are you looking for in terms of a result?

And yes, that code should work if pasted into the same location in index.template.php.

ATX1976

Well, since my theme has the "forum_title" in the image, I was just hoping to add a real H1 tag. I'm mainly concerned about the home page but site wide H1s would be great. Wasn't sure if a mod like this would do the trick. http://custom.simplemachines.org/mods/index.php?mod=2618

Antechinus

Ok, so assuming you are using the default theme and setting the banner image in admin, you want something like this:

<h1 id="forumtitle">
<span>', $context['page_title_html_safe'], '</span>
<a href="', $scripturl, '"><img src="', $context['header_logo_url_html_safe'], '" alt="', $context['forum_name'], '" /></a>
</h1>


Then you can set something on the span to hide it, like negative text-indent or z-index or whatever.


Advertisement: