I have just finished my first Joomla/Virtuemart site for a client.
They are now doing some SEO work and are insistent that the h1 tag needs to be removed from the logo.
Any help anyone could provide with the changes I need to make to the code would be greatly appreciated!
Otherwise I may need to go with just using one standard image and referring to another post on this forum about doing that. The only issue with this is that the site is currently fluid and they want to keep it that way, so not so keen to negotiate with them changing to a fixed width.
How do you remove h1 tag from logo?
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
-
- Joomla! Apprentice
- Posts: 17
- Joined: Tue Feb 03, 2009 12:04 am
- Location: Sydney, Australia
- jwwicks
- Joomla! Enthusiast
- Posts: 102
- Joined: Fri Jul 04, 2008 4:49 am
- Location: Sacramento, Ca
Re: How do you remove h1 tag from logo?
Hello Jillian,
and in the template.css starting at line 949
There are several ways to go about this. If you know they're just going to use a image then strip the section with the else in index.php and change the h1 to a div. Then change the css to use the div.logo...
If they might use the Text Only logo with the slogan then you'll need to change the first part in the index.php as before, change the h1 to a div, leaving the else section alone.
Then just add the following in the template.css
Jw
Basically the code starts on line 116 in the index.php filejillianheinrich wrote:I have just finished my first Joomla/Virtuemart site for a client.
They are now doing some SEO work and are insistent that the h1 tag needs to be removed from the logo.
Code: Select all
<?php
$siteName = $tmpTools->sitename();
if ($tmpTools->getParam('logoType')=='image'): ?>
<h1 class="logo">
<a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $siteName; ?></span></a>
</h1>
<?php else:
$logoText = (trim($tmpTools->getParam('logoText'))=='') ? $config->sitename : $tmpTools->getParam('logoText');
$sloganText = (trim($tmpTools->getParam('sloganText'))=='') ? JText::_('SITE SLOGAN') : $tmpTools->getParam('sloganText'); ?>
<h1 class="logo-text">
<a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $logoText; ?></span></a>
</h1>
<p class="site-slogan"><?php echo $sloganText;?></p>
<?php endif; ?>
Code: Select all
h1.logo, h1.logo-text {
margin: 0 0 0 5px;
padding: 0;
font-size: 180%;
text-transform: uppercase;
}
h1.logo a {
width: 208px;
display: block;
background: url(../images/logo.png) no-repeat;
height: 80px;
position: relative;
z-index: 100;
}
h1.logo a span {
position: absolute;
top: -1000px;
}
h1.logo-text a {
color: #CCCCCC !important;
text-decoration: none;
outline: none;
position: absolute;
bottom: 40px;
left: 5px;
}
If they might use the Text Only logo with the slogan then you'll need to change the first part in the index.php as before, change the h1 to a div, leaving the else section alone.
Code: Select all
if ($tmpTools->getParam('logoType')=='image'): ?>
<div class="logo">
<a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $siteName; ?></span></a>
</div>
Code: Select all
div.logo a {
width: 208px;
display: block;
background: url(../images/logo.png) no-repeat;
height: 80px;
position: relative;
z-index: 100;
}
div.logo a span {
position: absolute;
top: -1000px;
}
Computers are useless, they can only give you answers. - Pablo Picasso
-
- Joomla! Apprentice
- Posts: 17
- Joined: Tue Feb 03, 2009 12:04 am
- Location: Sydney, Australia
Re: How do you remove h1 tag from logo?
Hi Jw
Thanks so much for your great instructions. They confirmed what I sort of thought needed to be changed, but just didn't have the confidence in what I was doing because I'm still a bit new to hacking php files.
It all worked perfectly. Since they are only using an image, I stripped the else section in index.php and added the div.logo items in the css (with some adjustments I had made to h1.logo items previously).
Thanks again for the straight-forward reply.
Kindest regards
Jill
Thanks so much for your great instructions. They confirmed what I sort of thought needed to be changed, but just didn't have the confidence in what I was doing because I'm still a bit new to hacking php files.
It all worked perfectly. Since they are only using an image, I stripped the else section in index.php and added the div.logo items in the css (with some adjustments I had made to h1.logo items previously).
Thanks again for the straight-forward reply.
Kindest regards
Jill
- baijianpeng
- Joomla! Guru
- Posts: 516
- Joined: Mon Mar 20, 2006 3:17 pm
- Location: China
- Contact:
Re: How do you remove h1 tag from logo?
hi, jwwicks ,
I am using the JA Purity template on Joomla 1.5.12 now. It is on local testing server, so I can't give you a link to see the effect.
I also want to remove the H1 tag. I use Logo text.
At first, I changed h1 in file index.php to div, all those 4 tags.
Next, I go to the template.css file, found that those code you asked to insert had been already there. I just replaced those h1.logo with div.logo.
Then, I tried to view the result at frontend. After refresh, I noticed that the logo text is very small with a underline.
Did I missed something?
Thanks.
Edit:
OK, I found the cause at last. It was a conflict between the CSS and a plugin I installed. The above posts worked properly after I disabled that plugin.
Thank you.
I am using the JA Purity template on Joomla 1.5.12 now. It is on local testing server, so I can't give you a link to see the effect.
I also want to remove the H1 tag. I use Logo text.
At first, I changed h1 in file index.php to div, all those 4 tags.
Next, I go to the template.css file, found that those code you asked to insert had been already there. I just replaced those h1.logo with div.logo.
Then, I tried to view the result at frontend. After refresh, I noticed that the logo text is very small with a underline.
Did I missed something?
Thanks.
Edit:
OK, I found the cause at last. It was a conflict between the CSS and a plugin I installed. The above posts worked properly after I disabled that plugin.
Thank you.