Shape 5

Joomla Templates => Corpway - Club => : bollinger March 22, 2016, 11:48:08 AM



: How to change H2 header to H1
: bollinger March 22, 2016, 11:48:08 AM
Hi, for SEO is there a way to make headers h1 and not h2, easily?

Any experience or feedback would be great!

enmu.edu

Matthew


: Re: How to change H2 header to H1
: mikek March 23, 2016, 07:39:30 AM
Hello,

Not through the template, those are actually outputted directly through Joomla itself.


: Re: How to change H2 header to H1
: bollinger March 23, 2016, 08:13:33 AM
Ok, thank you.


: Re: How to change H2 header to H1
: gsquad July 14, 2016, 08:16:30 PM
This may be a little late, I was looking for the same solution. Since there was no real solution, I figured I'd contribute :)

This can be achieved fairly easily by creating a template override. You will need FTP access and a basic understanding of HTML. Overrides do not mess with the Joomla core or your Template's core files, so it's a pretty safe practice to make tweaks to the core functionality of Joomla within a template.

  • Go to Extensions > Templates
  • On the left sidebar menu, switch from Styles to Templates
  • Click on the Title of the template you are using
  • Click on the tab "Create Overrides"
  • Under Components, Click on com_content (it will open the folder)
:
  • Click on "article" -- Joomla with generate the override file for you and show you where it's located. Ex: Override created in /templates/your_template/html/com_content/article
  • Got to that folder via FTP open it and edit the default.php file.

When you have the default.php file open in your favorite text editor, change the following code (Should be the same, but may be slightly different, I'm using the general Contractor template):

:
<?php if ($params->get('show_title')) : ?>
<h2 itemprop="name">
<?php echo $this->escape($this->item->title); ?>
</h2>
<?php endif; ?>

To this:

:
<?php if ($params->get('show_title')) : ?>
<h1 itemprop="name">
<?php echo $this->escape($this->item->title); ?>
</h1>
<?php endif; ?>

Save your override file and refresh your site, you should be good to go.

Overrides are great, one of the reasons I've stayed in the Joomla camp for years. If you mess up, just delete the override files and start the process again.

If you have any questions, feel free to ask.

Take care,
john


: Re: How to change H2 header to H1
: cspgsl September 20, 2016, 06:49:07 AM
Thanks for this John - always learning

This may be a little late, I was looking for the same solution. Since there was no real solution, I figured I'd contribute :)

This can be achieved fairly easily by creating a template override. You will need FTP access and a basic understanding of HTML. Overrides do not mess with the Joomla core or your Template's core files, so it's a pretty safe practice to make tweaks to the core functionality of Joomla within a template.

  • Go to Extensions > Templates
  • On the left sidebar menu, switch from Styles to Templates
  • Click on the Title of the template you are using
  • Click on the tab "Create Overrides"
  • Under Components, Click on com_content (it will open the folder)
:
  • Click on "article" -- Joomla with generate the override file for you and show you where it's located. Ex: Override created in /templates/your_template/html/com_content/article
  • Got to that folder via FTP open it and edit the default.php file.

When you have the default.php file open in your favorite text editor, change the following code (Should be the same, but may be slightly different, I'm using the general Contractor template):

:
<?php if ($params->get('show_title')) : ?>
<h2 itemprop="name">
<?php echo $this->escape($this->item->title); ?>
</h2>
<?php endif; ?>

To this:

:
<?php if ($params->get('show_title')) : ?>
<h1 itemprop="name">
<?php echo $this->escape($this->item->title); ?>
</h1>
<?php endif; ?>

Save your override file and refresh your site, you should be good to go.

Overrides are great, one of the reasons I've stayed in the Joomla camp for years. If you mess up, just delete the override files and start the process again.

If you have any questions, feel free to ask.

Take care,
john