How to make my site title H1?
-
Hi
In my Header.php I have the following php code for my title:
<title><br /><?php<br />// Generate Page Title dynamically<br />if (is_home()) {<br /> bloginfo('name'); ?> - <?php bloginfo('description');<br />} elseif (is_category()) {<br /> single_cat_title(); ?> - <?php bloginfo('name');<br />} elseif (is_single()) {<br /> single_post_title();<br />} elseif (is_page()) {<br /> bloginfo('name'); ?>: <?php single_post_title();<br />} elseif (is_404()) {<br /> bloginfo('name'); ?> - <?php _e("Page not found", "fungames");<br />} elseif (is_search()) {<br /> bloginfo('name'); ?> - <?php _e("Search results for", "fungames"); echo esc_html($s, 1);<br />}<br />?><br /></title>
This generates a good title different for every page/post I have on my site. But is now H1. I want the same code if, but with H1 tag somewhere in it. Cant figure it out how to do it!
Can u help please?
-
Here is what I use in the PHP files for pages and posts on my Wordpress sites:
class="entry-title post-title">Name of Website Page
Note: I don't think I've ever seen someone put the page title in the header file. You may want to move it to the template files for posts/pages.
In your case, though, it may work just to put an H1 tag at the beginning and end of the whole thing:
<title><br /><?php<br />// Generate Page Title dynamically<br />if (is_home()) {<br /> bloginfo('name'); ?> - <?php bloginfo('description');<br />} elseif (is_category()) {<br /> single_cat_title(); ?> - <?php bloginfo('name');<br />} elseif (is_single()) {<br /> single_post_title();<br />} elseif (is_page()) {<br /> bloginfo('name'); ?>: <?php single_post_title();<br />} elseif (is_404()) {<br /> bloginfo('name'); ?> - <?php _e("Page not found", "fungames");<br />} elseif (is_search()) {<br /> bloginfo('name'); ?> - <?php _e("Search results for", "fungames"); echo esc_html($s, 1);<br />}<br />?><br /></title>
I hope this may help -- good luck!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Homepage Slider How to Handle H1 and H2's
Working on a site with a slider on the homepage, I dislike them but owner wants to keep in place. Currently, the slider has 4 slides with different images but the same text, so the slider has 4 slides with 4 identical H2 tags and accompanying text. There is no H1 tag on the page at all. It seems to me that a better solution would be to change the first slide to be H1 (with the target keyword) and rework the text in the other slides as H2 tags to appeal to the user. This does mean that the H1 and H2 tags in the slider would be styled the same. Is this a sensible approach?
Web Design | | GrouchyKids1 -
How to find out that none of the images on my site violates copyrights? Is there any tool that can do this without having to check manually image by image?
We plan to add several thousand images to our site and we outsourced the image search to some freelancers who had instructions to just use royalty free pictures. Is there any easy and quick way to check that in fact none of these images violates copyrights without having to check image by image? In case there are violations we are unaware of, do you think we need to be concerned about a risk of receiving Takedown Notices (DMCA) before owner giving us notification for giving us opportunity to remove the photo?
Web Design | | lcourse1 -
Footer links on my site... bad for passing page rank?
i've been told that it is possible that google discounts the weight or page rank passed in footer links of websites and my website has the navigation to many of my pages in the footer of each page. My whole website is about 20 pages so each page has links to the 5 most popular pages at the top and the rest of the links are in the footer of each page. Am i losing page rank by having these links in the footer? Should i make my navigation different? I have lots of articles on my site so i thought it might be not only helpful to my readers but give my pages an seo boost if i placed in context links in the body of my articles to other pages of my site. Does this sound like a good idea? Thanks mozzers! Thanks mozzers!
Web Design | | Ron100 -
404's and a drop in Rank - Site maps? Data Highlighter?
I managed an old (2006 design) ticket site that was hosted and run by the same company that handled our point of sale. (Think, really crappy, customer had to click through three pages to get to the tickets, etc.) In Mid February, we migrated that old site to a new, more powerful site, built by a company that handles sites exclusively for ticket brokers. (My site: TheTicketKing. - dot - com) Before migration, I set up 301's for all the pages that we had currently ranked for, and had inbound links pointing to, etc. The CMS allowed me to set every one of those landing pages up with fresh content, so I created unique content for all of them, ran them through the Moz grader before launch, etc. We launched the site in Mid February, and it seemed like Google responded well. All the pages that we had 301's set up for stayed up fairly well in rank, and some even reached higher positions, while some took a few weeks to get back up to where they were before. Google was also giving us an average of 8-10K impressions per day, compared to 3000 per day with the old site. I started to notice a slow drop in impressions in mid April (after two months of love from Google,) and we lost rank on all our non branded pages around 4/23. Our branded terms are still fine, we didn't get a message from Google, and I reached out to the company that manages our site, asking if they had any issues with their other clients. They suggested that I resubmit our sitemaps. I did, and saw everything bump back up (impressions and rank) for just one week. Now we're back in the basement with all the non branded terms once again. I realize that Google could have penalized us without giving us a message, but what got me somewhat optimistic was the fact that resubmitting our sitemaps did bring us back up for around a week. One other thing that I was working on with the site just before the drop was Google's data highlighter. I submitted a set of pages that now come back with errors, after Google seemed to be fine with the data set before I submitted it. So now I'm looking at over 300 data highlighter errors when I'm in WMT. I deleted that set, but I still get the error listings in WMT, as if Google is still trying to understand those pages. Would that have an effect on our rank? Finally I do see that our 404's have risen steadily since the migration, to over 1000 now, and the people who manage the CMS tell me that it would have no effect on rank overall. And we're going to continue to get 404's as the nature of a ticket site would dictate? (Not sure on that, but that's what I was told.) Would anyone care to chime in on these thoughts, or any other clues as to my drop?
Web Design | | Ticket_King0 -
301 forwarding during site migration problem - several url versions of the same page....
Hello, I'm migrating from an old site to a new site, and 301 forwarding many of the pages... My key problem is this I'm seeing www.website.com/ indexed in SE and www.website.com/default.aspx in showing as URL when I'm on homepage - should I simply 301 forward both of these? Then for several internal pages there are 2/3 versions of each page indexed. Canonicalization issues. Again, I'm wondering whether I should 301 forward each URL even if there are several different indexed URLs for the same page? Your advice will be welcome! Thanks in advance - Luke
Web Design | | McTaggart0 -
Site down for more than a month - lost rankings
Hello, We have run into a situtation where we had multiple pages setup for different keywords but didn't realize that we had a name server issue that has caused the pages to be down for the last month or so (2-3 weeks on the low side.) The rank finder was still working fine, but the offline page was never reported. We realized the situation recently and have since gotten the sites back online under the new nameservers. Most of these sites were ranking 1 and 2 spots in their keywords, and now are no where to be found in the Google Index. Should I do anything differently, or just put the sites back online and wait it out? I have seen in different places that it may only take 2 weeks to come back, but it's possible that Google has marked the sites as 'not quality' because of their downtime and it will be even harder to get them to rank again. Can anyone shed any light on this situation? Any information is appreciated. Thanks in advance.
Web Design | | EQ-Richie0 -
What is a really great bounce rate for a product or service site? What does Good look like?
I am really curious about a result I have never seen before. Our bounce rate went down a lot on a new site. So, what is good??? Recently, we took on a project with a company that offers a product they install for consumers and who had been in business for 15 plus years. The company is successful, has good customer base of those who have been made very happy, etc. It is not a repeat sale type of product, etc. One and done. Their site when we began talking was roughly a year old and was not well constructed but not terrible. Most of the issues were around I frames, use of older coding, poor SEO, etc. There was not really a way to "redesign" and we built a new site. This became a true collaboration in a B2B environment as the owner pushed us like crazy. Not the bad kind of push, the one that makes you say to your team, "Let's find a way!" The result, IMO, was a gorgeous site. But, as you know, those are a dime a dozen. But, to get to the point, when we took over the account they had a bounce rate of around 45%. I did not see this as either good or bad, but a fact and for this industry probably not bad at all. In all honesty, I was not looking at that as a first metric I wanted to move, but it was obviously at or near the top for all the reasons we know. So, this site is a local business, not an everyday product and gets about 2500 to 3000 uniques per month. If we compare to May of 2011/2012: 2011 2012 Total Visitors 1852 3,298 Uniques 1609 2,740 Pageviews 5,634 23,203 Pages/visit 3.04 7.04 Avg Duration 2.05 3.20 Yes, I am leaving off what we are getting, yes, I am leaving off the site. Please don't hate me. I am really wanting to see what others see with site changes and bounce rates first and will disclose. So, what's a great bounce rate? How do you know?
Web Design | | RobertFisher0 -
What reason would scrapers, and syndication sites outrank all of our content?
Typing in any of our titles for content, scrapers and content syndication sites all outrank us by quite a bit. What is the main reason for this usually? I started noticing this happening quite a bit this year, and think maybe it has to do with panda. Has anyone figured out the reasoning?
Web Design | | upbuiltgames0