Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi,
I'd like to know how to add the meta tags description and keywords to the frontpage. Only meta tags content type and generator appear on my site.
and also how to modify those meta tags
Thank you for your help
Comments
Comment #1
gtsopour CreditAttribution: gtsopour commentedComment #2
gtsopour CreditAttribution: gtsopour commentedHello abonados
You can use drupal_add_html_head() for adding meta description and meta keywords in header. In Bluemasters theme template.php file, you can call hook_page_alter() for embeding meta. If you want to add meta description and meta keywords in your site then go to your template.php file and paste the code (display below):
Finally change 'content' with your content.
Thanks
George
Comment #4
ressa CreditAttribution: ressa commentedThanks @gtsopour, I tried to get your example to work with the Bartik theme, to only show the description on the front page, but couldn't make it work. It works if I use hook_preprocess_html in stead though:
You can insert the site slogan like this (in stead of 'some description here'):
'content' => check_plain(variable_get('site_slogan', ''))
Comment #5
vlad074 CreditAttribution: vlad074 commentedConcerning to the first answer:
'some description here' - it is a static parameter,
how can i input a variable from "Metatag" module, non-static?
Or from something else module