Meta keywords on home page OpenCart
In the admin
Go to admin/controller/setting/setting.php file
you will find a line $this->data['entry_meta_description'] = $this->language->get('entry_meta_description'); and put below line after that
$this->data['entry_meta_keywords'] = $this->language->get('entry_meta_keywords');
Now search for config_meta_description word, put below code after this
if (isset($this->request->post['config_meta_keywords'])) {
$this->data['config_meta_keywords'] = $this->request->post['config_meta_keywords'];
} else {
$this->data['config_meta_keywords'] = $this->config->get('config_meta_keywords');
}
Open the file admin/language/english/setting/setting.php and add a line after the entry_meta_description line that says
$_['entry_meta_keywords'] = 'Meta Tag Keywords:';
open the file admin/view/template/setting/setting.tpl, find the config_meta_description and paste this after it.
<tr>
<td><?php echo $entry_meta_keywords; ?></td>
<td><input type="text" name="config_meta_keywords" value="<?php echo $config_meta_keywords; ?>" /></td>
</tr>
Now come In the front end
Open the file catalog/view/theme/yourtheme/template/common/header.tpl and add the following code after the definition of the description meta tag:
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
Finally, open catalog/controller/common/home.php and find $this->document->setDescription($this->config->get('config_meta_description'));. Simply add below line after it....
$this->document->setKeywords($this->config->get('config_meta_keywords'));
Thats it.... Enjoy Chandresh rana's Coding... :)
4 comments:
Thanks Dude Awesome your programming:)
Thanks a lot bro...now keyword insertion option displaying in admin area.
Welcome Friends... :)
Greetings! I've been following your web site for a llong time now and finally got the bravery to go
ahead annd giive you a shout out from Houston Tx!
Just wanted to tell you keep up the good work!
Feel free to visit mmy blog post :: شركة تسليك مجارى بالرياض
Post a Comment