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!
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
-
Site move?
What happens in a site move from a subdomain to a new domain and how does that effect the root domain of the subdomain and whether or not the subdomain SEO would be transferred to the new domain?
Web Design | | Jjjay1 -
Is placing an H1 tag below a slideshow a bad practice?
Hello All, It is to my understanding that it is a best practice to have a single H1 headline that corresponds to your title tag at the top of your page, above your content for the best On-Site Optimization. We are developing a site that uses a big slideshow with text on each slide, and are concerned that placing the H1 Headline below this will be a bad practice. Would a better option be to have the slide show text on the image and place no alt tags on the slides, so that the crawlers accessing the page overlook this and see the H1 below the slider first? We need to maintain the slider for design purposes, but would like the site to optimized. A similar example to what the slider will look like is as follows: http://www.boviskyle.com/ However, we look to have optimized, "10x" content below the slider with a solid H1 headline as well. Thank You!
Web Design | | Armen-SEO0 -
ECWID Ecommerce Sites. No Custom URLS?
Is there any way possible to be able to name product urls in website that use ECWID for their ecommerce? They have long and "dirty" urls. For example this running boards site: http://www.runningboards4less.com/general-motors#!/~/product/category=6593890&id=28043027 Isn't this hurting the overall SEO of the site? Especially product pages?
Web Design | | Atlanta-SMO0 -
Duplicate H1 tag IF it holds SAME text?
Hello people, I know that majority of SEO gurus (?) claim that H1 tag should only be used once per page. In the landing page design I'm working with, we actually need to repeat our core message stated in H1 & H2 - at the bottom of the page. Now the question is: Can that in any way cause any ranking penalty from big G? In my eyes that is not attempt to over optimize page as it contains SAME info as the H1 & H2 at the top of the page. Confusing, so I'm hope that some SEO gurus here will share some light on this. Thanks in advance!
Web Design | | RetroOnline0 -
Image sliders & site speed
We are having a new website designed using WordPress and the Genesis framework. We wanted to include header image sliders on a number of internal site pages, but our designer says that sliders on more than just the home page will slow down the site significantly. How much could they slow down the site, and what can be done to minimize their effect on site speed?
Web Design | | GordyH0 -
Will upgrading my dedicated server improve my site speed
hi, at the moment i am concerned about my site speed for www.in2town.co.uk My hosting company is tmd hosting and my package is Intel Atom 330 1MB L2 Cache 1.6GH $159/mo $189/month500GBStorage4GBRAM10TBBandwidthi am looking at increasing this to**$219/mo** $289/month500GBStorage6GBRAM10TBBandwidthcan anyone let me know if this will make a difference to my site speed please
Web Design | | ClaireH-1848860 -
Spammy page titles and the consequences
Hiya Mozzers! A pal who works in SEO has suggested I add the following type <title>tag structure to my pages:<br /><br />Bars in New York - Bars New York [no brand name]</p> <p>Pizzas in New York - Pizzas New York [no brand name]</p> <p>Firstly, I think this looks spammy, secondly, can't understand the logic of both combinations, thirdly, my understanding is brand name lessens importance of keyphrases, but it's still important from a branding point of view.</p> <p>Fourthly, is this sustainable? I mean, Google could identify this as spammy in the future, with penalty, no? Any feedback on these points would be very useful.</p> <p>Also, he said that I should play around with title tags on an ongoing basis, but I haven't changed any single title tag more than once/6 months for fear of being flagged for manipulative SEO practice by Google. Guidance here would be great as well.</p> <p>Thanking you in advance, Luke</p></title>
Web Design | | McTaggart0 -
What is value in site aggregation?
If one was to own 5 sites that were in a similar vertical and at some point decide that managing 5 sites was more of a pain than managing 1,2, or 3, is it possible to combine sites via 301 redirects and increase the overall DA, and for urls that are similar, PA? So, we have site Hairbrush.com, comb.info, trimmer.com, hairmud.org, and barber.net: Assuming that they have a DA of Hairbrush.com = 32 Comb.info = 36 Trimmer.com = 27 Hairmud.org = 21 Barber.net = 44 Is there any testing that has shown combining the first 4 would increase the Comb.info from DA of 36 to DA of 51, etc? Is there any testing regarding the same, but with Page Authority? Thanks PS Assume other variables are equal. I also realize this could look as if they were all ECommerce, but what if they were service or bricks and mortar?
Web Design | | RobertFisher0