Keyword

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

  • Chris Hogan
  • Chris Hogan's Avatar Topic Author
  • Offline
  • Senior Member
More
5 days 1 hour ago - 5 days 1 hour ago #171515 by Chris Hogan
Chris Hogan created the topic: Issue after changing H2 to H1 and the FEATURED <sup>
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 days 1 hour ago by Chris Hogan.

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

  • Fotis
  • Fotis's Avatar
  • Online
  • Administrator
  • JoomlaWorks Support Team
More
4 days 21 hours ago #171527 by Fotis
Fotis replied the topic: Issue after changing H2 to H1 and the FEATURED <sup>
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 ;)


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

Moderators: william white