help with <h1> other than the_title please
-
Hi
This is my first installation of wordpress and also my first post for support on this forum.
I’m creating a small site and using WordPress as a basic CMS which so far has gone well.
I have created some pages – homepage, about, sevices, contact etc – that use the title of the page as the link in the nav list and also the <h1> on the page.
However I want the home page to write ‘Home’ in the nav list – which is working fine – but ‘Widgets’ (for example) as the <h1>, so have called the title of the page ‘Home’ and written this code:
<h1><?php if (the_title(‘Home’)) {
echo ‘Widgets’;
} else ( the_title() )
?></h1>I also wroteif (the_title() ==’Home’)
I was hoping this would mean that if the title of the page is ‘Home’ then it would write the <h1> as ‘Widgets’ and for any of the other pages then the <h1> would write its title….
But lo and behold his isn’t working! What I’m getting is the <h1> tags are writing ‘HomeHomeHome’ or ‘HomeAboutAbout’ etc depending on what page you are on.
…this no doubt is when you’re thinking – well of course they are!
And that is why your help with this would be appreciated!
Thanks
-
You need to be asking at WordPress.org, as we here at WordPress.com are running different software and won’t be able to help you.
-
- The topic ‘help with <h1> other than the_title please’ is closed to new replies.