Keyword

Issue after changing H2 to H1 and the FEATURED <sup>

  • Chris Hogan
  • Chris Hogan's Avatar Topic Author
  • Offline
  • Premium Member
More
5 years 1 month ago - 5 years 1 month ago #171515 by Chris Hogan
Hi there,

I've just changed my H2 tags to H1 titles instead (for SEO purposes) and an issue with the FEATURED <sup> seems to have occured.

On the attachments you can see the way it did look (the correct way - in Red next to the Title) and the way it looks now (which doesn't look great underneath the Title)

The code below is the 'item.php' in my templates/cloudbase3/html/com_k2/default folder: At present I've moved the closing </h1> above the 'Featured Flag area....instead of the end of this code - as it had also turned the <sup> to H1 size as well!
<h1 class="itemTitle">
		<?php if(isset($this->item->editLink)): ?>
		<!-- Item edit link -->
		<span class="itemEditLink">
			<a data-k2-modal="edit" href="<?php echo $this->item->editLink; ?>"><?php echo JText::_('K2_EDIT_ITEM'); ?></a>
		</span>
		<?php endif; ?>

		<?php echo $this->item->title; ?>
		</h1>

		<?php if($this->item->params->get('itemFeaturedNotice') && $this->item->featured): ?>
		<!-- Featured flag -->
		<span>
			<sup>
				<?php echo JText::_('K2_FEATURED'); ?>
			</sup>
		</span>
		<?php endif; ?>

Any idea how get it back to way it was looking...and with a h1 tag??
Attachments:
Last edit: 5 years 1 month ago by Chris Hogan.

Please Log in or Create an account to join the conversation.

More
5 years 1 month ago #171527 by JoomlaWorks
That's because the CSS that applied the red color and positioning was bound to the h2 tag. I would recommend you override K2's CSS file (simply copy the file /components/com_k2/css/k2.css into your /templates/YOUR_TEMPLATE/css/ folder and then look for the tag "sup" in the file and adjust the selector to it accordingly.

In the dev version of K2, that line is 197: github.com/getk2/k2/blob/master/components/com_k2/css/k2.css#L197 (you swap h2 there with h1).

Keep in mind that the reason we leave h2 in the title is because h1 is usually left for the site name. There's a reason why K2's markup is what it is ;)

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum