Help with adding H1 to Title

I would like to add H1 to the title in the code below…

So title="<?php bloginfo( ‘name’ ); has a H1 value

All help appreciated.

<?php if(admania_get_option('admania_custom_logo_activestatus') != false) { 				
				    if(is_home()): ?>
					<h1 class="admania_sitetitle" itemprop="headline">
					<a href="<?php echo esc_url(home_url('/')); ?>" title="<?php bloginfo( 'name' ); ?>">
					<img src="<?php echo esc_url(admania_get_option('admania_custom_logo')); ?>" alt="<?php bloginfo( 'name' ); ?>" itemprop="image"/>
					</a>
					</h1>
					<?php else: ?>

I think you are missing an echo title="<?php echo bloginfo( 'name' ); ?>"

I didn’t get your question properly, can u please elaborate ??

1 Like

The title in the code shown is surely just the additional information shown when the user hovers over the link in their browser, and I didn’t think that could be styled with additional tags.

If it can be, surely it’s just a case of adding the open and close H1 tags just inside the quotes?

1 Like

AFAIK, you can’t… the title attribute is just some additional information, and it’s up to the browser what to do with it (e.g. it may be affected by your browser/desktop theme etc.). Also, a 1st level heading as a tooltip doesn’t seem particularly semantic to me anyway. ;-) If you want some custom hover content, you might do something like

[data-title] {
  position: relative;
}

[data-title]:hover:after {
  content: attr(data-title);
  position: absolute;
  left: 100%;
  font-size: 2em;
}
<a href="#" data-title="foo">bar</a>
1 Like

Thank you everyone for your replies, I understand what you are saying.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.