SOLVED How to change article titles from <h2> to <h1>?

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

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.
Locked
Babelfish44
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sun Dec 19, 2010 2:47 pm

SOLVED How to change article titles from <h2> to <h1>?

Post by Babelfish44 » Fri Dec 24, 2010 8:26 pm

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.
Last edited by Babelfish44 on Sat Dec 25, 2010 12:05 am, edited 1 time in total.

User avatar
219jondn
Joomla! Guru
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>?

Post by 219jondn » Fri Dec 24, 2010 10:06 pm

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!
Respectfully,
Jon Neubauer
Tweet at me @219jondn

Babelfish44
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sun Dec 19, 2010 2:47 pm

Re: How to change article titles from <h2> to <h1>?

Post by Babelfish44 » Fri Dec 24, 2010 10:13 pm

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?

User avatar
jmuehleisen
Joomla! Virtuoso
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>?

Post by jmuehleisen » Fri Dec 24, 2010 10:21 pm

It could be hard coded as <h2> in the template html override in the php itself.

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

Babelfish44
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sun Dec 19, 2010 2:47 pm

Re: How to change article titles from <h2> to <h1>?

Post by Babelfish44 » Fri Dec 24, 2010 10:32 pm

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?

User avatar
jmuehleisen
Joomla! Virtuoso
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>?

Post by jmuehleisen » Fri Dec 24, 2010 10:37 pm

Should I just try to move it into the <h1> tag?
Yes
John Muehleisen
Visit my "Getting Started with Joomla" site, now with videos, tips, and new user tutorials:  http://welcometojoomla.com

Babelfish44
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sun Dec 19, 2010 2:47 pm

Re: How to change article titles from <h2> to <h1>?

Post by Babelfish44 » Fri Dec 24, 2010 10:55 pm

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 :)

User avatar
jmuehleisen
Joomla! Virtuoso
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>?

Post by jmuehleisen » Fri Dec 24, 2010 11:01 pm

just change the <h2> to <h1> and the </h2> to </h1>

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

Babelfish44
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Sun Dec 19, 2010 2:47 pm

Re: How to change article titles from <h2> to <h1>?

Post by Babelfish44 » Sat Dec 25, 2010 12:04 am

jmuehleisen wrote:just change the <h2> to <h1> and the </h2> to </h1>

That should do it for you.
Did that now, and it worked just fine, problem solved. Thanks for your help!


Locked

Return to “General Questions/New to Joomla! 1.5”