MyDaily-Gadget
Member
Posted 1 year ago #
Hello there,
I added the following meta description into my header.php file
<meta name="Description" content=" The latest news and guides in the cellphone, laptops, PC, tablets and games area. We also make the latest downloads and reviews, thanks to our great team." />
It works OK, excepting the fact that it doesn't appear only on my main page. It shows on all of my pages. In the following image I have searched for the title of my post.
http://img707.imageshack.us/img707/8551/capturepjt.jpg
How can i make this meta description appear only on my main page, leaving Google to decide what to show for others?
<?php if( is_front_page() || is_home() ) {?>
<meta name="Description" content=" The latest news and guides in the cellphone, laptops, PC, tablets and games area. We also make the latest downloads and reviews, thanks to our great team." />
<?php } ?>
MyDaily-Gadget
Member
Posted 1 year ago #
That code above is good, although if your front page is a static page, then both your home page and your blog will share the same description. If you want to differentiate between the two, place the is_front_page() and is_home() in different if statements (is_home is actually your blog page, whatever you yourself might consider to be your "home" page)