SOLVED How to change article titles from <h2> to <h1>?
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
-
- Joomla! Apprentice
- Posts: 19
- Joined: Sun Dec 19, 2010 2:47 pm
SOLVED How to change article titles from <h2> to <h1>?
I wonder if anyone knows if it's any simple modifications I can do to make my site code article titles in <h1> instead of <h2>? Now my template automatically displays article titles as <h2>, but for Google-reasons, I would like this to be <h1>.
I know I should ask the template provider, and I've posted the question in their forum also, but hasn't received any answer.
I know I should ask the template provider, and I've posted the question in their forum also, but hasn't received any answer.
Last edited by Babelfish44 on Sat Dec 25, 2010 12:05 am, edited 1 time in total.
- 219jondn
- Joomla! Guru
- Posts: 640
- Joined: Sat Jun 26, 2010 9:15 pm
- Location: Charlotte, NC, USA | Köln, NRW, DE
Re: How to change article titles from <h2> to <h1>?
Most templates already place the article title as H1 - before changing anything I would use Firebug or just do F+12 in your browser and locate the article title and see if it is already H1.
If for some odd reason it isn't. that shouldn't be too hard to change in the template CSS
Hope that helps!
If for some odd reason it isn't. that shouldn't be too hard to change in the template CSS
Hope that helps!
Respectfully,
Jon Neubauer
Tweet at me @219jondn
Jon Neubauer
Tweet at me @219jondn
-
- Joomla! Apprentice
- Posts: 19
- Joined: Sun Dec 19, 2010 2:47 pm
Re: How to change article titles from <h2> to <h1>?
I chekced with Firebug, and the article title is coded as <h2> - that's why I want to change it Any tips for what to look for in the CSS file?
- jmuehleisen
- Joomla! Virtuoso
- Posts: 4874
- Joined: Thu Nov 09, 2006 2:46 pm
- Location: Kampala, Uganda
- Contact:
Re: How to change article titles from <h2> to <h1>?
It could be hard coded as <h2> in the template html override in the php itself.
look in /templates/template-name/html/com_content/ ...
look in /templates/template-name/html/com_content/ ...
John Muehleisen
Visit my "Getting Started with Joomla" site, now with videos, tips, and new user tutorials: http://welcometojoomla.com
Visit my "Getting Started with Joomla" site, now with videos, tips, and new user tutorials: http://welcometojoomla.com
-
- Joomla! Apprentice
- Posts: 19
- Joined: Sun Dec 19, 2010 2:47 pm
Re: How to change article titles from <h2> to <h1>?
This is the reference for <h2> I find in /com_content/default.php:
<h2 class="contentheading<?php echo $this->escape($this->params->get( 'pageclass_sfx' )); ?> clearfix">
<?php if ($this->params->get('link_titles') && $this->article->readmore_link != '') : ?>
<span>
<a href="<?php echo $this->article->readmore_link; ?>" class="contentpagetitle<?php echo $this->escape($this->params->get( 'pageclass_sfx' )); ?>"><?php echo $this->escape(isset($this->article->page_title)?$this->article->page_title:$this->article->title); ?></a>
</span>
<?php else : ?>
<span><?php echo $this->escape(isset($this->article->page_title)?$this->article->page_title:$this->article->title); ?></span>
<?php endif; ?>
</h2>
I guess I've found the code line? Should I just try to move it into the <h1> tag?
<h2 class="contentheading<?php echo $this->escape($this->params->get( 'pageclass_sfx' )); ?> clearfix">
<?php if ($this->params->get('link_titles') && $this->article->readmore_link != '') : ?>
<span>
<a href="<?php echo $this->article->readmore_link; ?>" class="contentpagetitle<?php echo $this->escape($this->params->get( 'pageclass_sfx' )); ?>"><?php echo $this->escape(isset($this->article->page_title)?$this->article->page_title:$this->article->title); ?></a>
</span>
<?php else : ?>
<span><?php echo $this->escape(isset($this->article->page_title)?$this->article->page_title:$this->article->title); ?></span>
<?php endif; ?>
</h2>
I guess I've found the code line? Should I just try to move it into the <h1> tag?
- jmuehleisen
- Joomla! Virtuoso
- Posts: 4874
- Joined: Thu Nov 09, 2006 2:46 pm
- Location: Kampala, Uganda
- Contact:
Re: How to change article titles from <h2> to <h1>?
YesShould I just try to move it into the <h1> tag?
John Muehleisen
Visit my "Getting Started with Joomla" site, now with videos, tips, and new user tutorials: http://welcometojoomla.com
Visit my "Getting Started with Joomla" site, now with videos, tips, and new user tutorials: http://welcometojoomla.com
-
- Joomla! Apprentice
- Posts: 19
- Joined: Sun Dec 19, 2010 2:47 pm
Re: How to change article titles from <h2> to <h1>?
The whole code between <h2> and </h2>? And the code under <h1> into <h2>?
Sorry for beeing a noob, but I've only used Joomla! for three days
Sorry for beeing a noob, but I've only used Joomla! for three days
- jmuehleisen
- Joomla! Virtuoso
- Posts: 4874
- Joined: Thu Nov 09, 2006 2:46 pm
- Location: Kampala, Uganda
- Contact:
Re: How to change article titles from <h2> to <h1>?
just change the <h2> to <h1> and the </h2> to </h1>
That should do it for you.
That should do it for you.
John Muehleisen
Visit my "Getting Started with Joomla" site, now with videos, tips, and new user tutorials: http://welcometojoomla.com
Visit my "Getting Started with Joomla" site, now with videos, tips, and new user tutorials: http://welcometojoomla.com
-
- Joomla! Apprentice
- Posts: 19
- Joined: Sun Dec 19, 2010 2:47 pm
Re: How to change article titles from <h2> to <h1>?
Did that now, and it worked just fine, problem solved. Thanks for your help!jmuehleisen wrote:just change the <h2> to <h1> and the </h2> to </h1>
That should do it for you.