Friday 6 July 2012

Meta data in magento in header part for Improve keywords in google search

Add this coding in head.phtml page

<?php if (Mage::registry('current_product')) : ?>
        <meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
        <title><?php echo Mage::registry('current_product')->getName().' ,'.Mage::registry('current_product')->getoemno().' ,'.Mage::registry('current_product')->getdescription(); ?> </title>
        <meta name = "description" Content = "<?php echo Mage::registry('current_product')->getdescription(); ?>" />
        <meta name = "oemno" Content = "<?php echo Mage::registry('current_product')->getoemno(); ?>" />
        <meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
        <meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
<?php else : ?>
        <meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
        <title><?php echo $this->getTitle() ?></title>
        <meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
        <meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
        <meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
<?php endif; ?>
<!--<title><?php echo $this->getTitle() ?></title>
<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
<meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
<meta name="Designer" content="WebAndPeople Magento design - http://webandpeople.com" /> -->
<link rel="icon" href="<?php echo $this->getSkinUrl('favicon.ico') ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getSkinUrl('favicon.ico') ?>" type="image/x-icon" />

No comments:

Post a Comment