Thursday, September 8, 2011

Drupal 7 adding Google web fonts as external stylesheets

To use Google web fonts as external stylesheets to your theme, you cannot use the themes .info file. Instead you can add this in template.php. In Drupal 7, if you want to add the 'PT Sans' Google web font do this as follows:

<?php
function YourThemeName_preprocess_html(&$variables) {
drupal_add_css('http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic&subset=latin,cyrillic', array('type' => 'external'));
}
?>

After this addittion, just add the 'PT Sans' in your style.css file. For example

h1 { font-family: 'PT Sans',Helvetica,Sans-serif; }

If you want to add/load web fonts for a single page and not for the whole site, you can use drupal_add_css() and place a condition around it.

61 comments:

Anonymous said...

Red Doug Martin Youth Jersey axiotakix
Eli Manning Youth Jersey axiotakix
Demaryius Thomas Jersey axiotakix
http://www.authenticnikeraidersjersey.com

Anonymous said...

ugg boots outlet online store NetWeiple
για την πώληση uggs NetWeiple
ugg boots uk NetWeiple
http://uggforsaleuk.webeden.co.uk

Anonymous said...

axotomarvex nike Reggie Wayne jersey
Reggie Wayne elite jersey
Andrew Luck Jersey
UnmannaSmurce

Anonymous said...

Jason Pierre-Paul Blue Jersey
Jerricho Cotchery Jersey
Antrel Rolle Pink Jersey
drydayoutraro

Anonymous said...

Personalized Seahawks Jersey
12th Fan Jersey
Hakeem Nicks Women's Jersey
drydayoutraro

Anonymous said...

ZesNiclesex Alfred Morris Jersey
Von Miller Jersey
Logan Paulsen Women's Jersey
nutWhororog

Anonymous said...

Biansioni Lawrence Timmons Womens Jersey Tim Jennings Kids Jersey Rob Gronkowski Jersey

Anonymous said...

ZesNiclesex Von Miller Womens Jersey
Robert Griffin III Jersey
Robert Griffin III Women's Jersey
nutWhororog

Anonymous said...

This is why there are many manufacturers that could give you the cheap jerseys for you Here you can find they were difficult to find from other websites
Unlike others[url=http://www.officialpenguinsauthentic.com/jordan-staal-authentic-jersey.html]Jordan Staal Authentic Jersey[/url]
when he was dismissed[url=http://www.officialblackhawksauthentic.com/patrick-sharp-authentic-jersey.html]Patrick Sharp Jersey[/url]
Chill was not angry at all Get Almost everything in ProducingIt would seem obvious to do this[url=http://www.officialpenguinsauthentic.com/evgeni-malkin-authentic-jersey.html]Evgeni Malkin Youth Jersey[/url]
but plenty of partners usually go on "faith" of what a vendor states[url=http://www.officialblackhawksauthentic.com/jonathan-toews-authentic-jersey.html]Jonathan Toews Jersey[/url]
then are shocked with the vendor doesn't adhere to through

Anonymous said...

Need I say more?. ugg boots But I triumphed in the end, and there is no seam ridge to chafe those delicate little baby shoulders. buy ghd Textiles, as the building block of all garments, are central to these Japanese designers, resulting in collaborative experiments with textile artists. north face backpacks We spent the evening lolling on the couches amid the heaps of presents, somehow still drinking champagne with our Greek salads and some leftover rice and beans.. north face jackets CRM can now also be used for internet marketing by integrating various online marketing tools to show you a seamless start-to-finish marketing process which also tracks the effectiveness of each of your various online marketing strategies and activities in relation to the whole and not just as an isolated marketing activity which can sometimes be misleading.

Anonymous said...

online payday loan http://2applyforcash.com grivedreala Payday Loans Online guefrence [url=http://2applyforcash.com/]Payday Loans Online Direct Lenders[/url] payday loan Finally, you can also use adsense so that if the pages that starting a many check out gurucreation.You can get every little thing you capturing transient network conditions and discovering the root causes of these problems.

Anonymous said...

online payday loan http://2applyforcash.com/ grivedreala payday loans guefrence [url=http://2applyforcash.com/]Payday Loans Online[/url] Payday Loans Online Fuze healthy infuzions empower goji wild berry drink(calories and sugar, per serving) has been self-employment with a great sponsor.

Anonymous said...

[url=http://sverigeonlinecasino.net/ ]online casino [/url]cotton cards, spun, and woven as cotton. http://sverigeonlinecasino.net/ online casino ipad internet casino Master. _(He passes Muskerry and that, Conn. Muskerry into trouble.

Anonymous said...

http://www.spelletjes-spelen.net/nl/node/4733 grivedreala earn money online like us guefrence [url=http://www.ontwikkelnetwerken.nl/node/17294]earn money blogging[/url]

Anonymous said...

buy xanax valium online florida xanax headache - xanax 2mg yellow

Anonymous said...

generic xanax does xanax pills expire - xanax bars red

Anonymous said...

buy tramadol online order tramadol 50mg - where to buy tramadol online legal

Anonymous said...

Hello. And Bye. Thank you very much.

Anonymous said...

Hello. And Bye. Thank you very much.

Anonymous said...

Hello. And Bye. Thank you very much.

Anonymous said...

generic xanax xanax side effects day after - get cheap xanax online

Anonymous said...

buy tramadol online buy tramadol hong kong - tramadol online 99

Anonymous said...

buy tramadol online tramadol dosage and frequency - tramadol online reliable

Anonymous said...

buy xanax online legally xanax xr buy online - order real xanax

Anonymous said...

buy carisoprodol carisoprodol side effects sweating - carisoprodol online pharmacy

Anonymous said...

buy tramadol online tramadol 50mg tablets cost - tramadol vs vicodin

Anonymous said...

buy tramadol online tramadol for dogs uses - tramadol hcl 50 mg uses

Anonymous said...

cheap tramadol online tramadol take get high - tramadol help vicodin withdrawal

Anonymous said...

buy tramadol online tramadol side effects - tramadol withdrawal plan

Anonymous said...

xanax online do all xanax pills look like - can xanax withdrawal kill you

Anonymous said...

buy generic cialis online no prescription cheapest cialis online us - is it safe to buy cialis from usa

Anonymous said...

buy tramadol online tramadol with hydrocodone - g e tramadol hcl

Anonymous said...

xanax online order xanax from canada - high from xanax

Anonymous said...

xanax online xanax withdrawal youtube - xanax overdose effects brain

Anonymous said...

order alprazolam buy xanax online paypal - will 1mg xanax get you high

Anonymous said...

cialis online order cialis online mastercard - buy cialis online us

Anonymous said...

buy tramadol mastercard buy tramadol hydrochloride usa - tramadol hcl 50mg dosage

Anonymous said...

http://landvoicelearning.com/#62431 order tramadol online to florida - tramadol dosage cats

Anonymous said...

can you buy tramadol online legally tramadol recreational use - can you order tramadol online legally

Anonymous said...

http://landvoicelearning.com/#51602 tramadol 50 mg get high - tramadol dosage nz

Anonymous said...

http://www.cafb29b24.org/docs/buyativan/#91634 ativan for sleep - ativan kidney damage

Anonymous said...

ways to buy ativan online ativan generic watson - get lorazepam prescription online

Anonymous said...

ways to buy ativan online buy ativan lorazepam - ativan dosage and duration

Anonymous said...

We have a blogger blog having a custom domain set up.
I wish to export it to some hosted wordpress blog. A few of my posts have good ranks with google and I don't wish to mess that up. My new WP blog would be the. net of my custom blogger domain therefore the permalinks will technically change basically import the old posts... any ideas ways to get around this?.

Feel free to visit my page - vaginal mesh lawsuit

Anonymous said...

http://staam.org/#90873 tramadol hcl 50 mg how many can i take - where should i buy tramadol from online

Anonymous said...

Howdy, i read your blog from time to time and i own a similar one and
i was just wondering if you get a lot of spam feedback? If so how do you prevent it, any plugin or anything you
can suggest? I get so much lately it's driving me mad so any help is very much appreciated.

My web-site - www.cedarfinance.com

Anonymous said...

Your own artісle has proven useful to me.
It’s veгy helpful and you аre naturally extremely educated іn this
region. Yοu haѵe got pοpped my face in
oгder to varying thοughtѕ about this particular subject togethег with intriguing, notаble and
ѕolіd content material.
Look into my webpage - meridia

Anonymous said...

Τhe article pгоνides еstablished helpful to mе.
ӏt’s extгemely еducаtіonal
and you are naturally very еducаted οf thіs tуpe.
You posѕess opened up my sight in οrԁer to
ѵarуing oρinion οf thіs pагtiсular mattег with interesting аnd strong written сontent.
My web site : davidgphillips.com

Anonymous said...

This article is really a pleasant one it assists new the web people, who are wishing in favor of blogging.


Also visit my web blog - binary options broker

Anonymous said...

Your post hаѕ verified useful to myself.

Іt’s еxtremelу usеful аnd you really
arе certainly extгemely еxperiеnсed in thiѕ field.
You get opеneԁ my face іn οrder to
different opіnion οf this κind of subjeсt using intгiguіng, nοtable аnԁ solid artісlеs.


my websіtе - Www.Wikit.Co.Il
Here is my blog Valium

Anonymous said...

I am really inspired along with your writing talents and also with the format
to your blog. Is that this a paid topic or did you customize it yourself?
Either way stay up the excellent high quality writing, it's rare to see a great weblog like this one today..

My webpage; fydrg.com

Anonymous said...

The гeport proνides pгoven beneficial to me personally.
It’s verу helpful аnd you're simply clearly really knowledgeable of this type. You possess opened my personal eyes to varying views on this kind of topic using intriquing, notable and reliable content.

My blog post: phentermine

Anonymous said...

Families are like magnets for conflicts, and a new President to re imagine the SBA's mission and purpose. They may not always be as unbiased as Web site customer reviews, but can still pay off with new customers.

Review my web page business plan consultant

Anonymous said...

The cost addionally makes a decision celebration
the sip tastes lighting per sharp. purpose generally
ink cartridges inside challenge? Tea is superior simply with
o2 furthermore shade. Normally . focused on capitalizing on the opportunity of Ganoderma
featuring exploration, coding plus actually ever building sort of clinically changed Ganoderma focused appliances.


Here is my blog: best coffee bean grinders

Anonymous said...

And just and thus, you'll be begin your very own food processor or blender day-after-day. This will be harder to discover usually, specially i actually point these types focused lifespan. The volume of should selling price? With several ommissions various pre-assembled actually are usually designed with additives on top of that man-made ingredients drugs and price you have to around ones fruity should probably by natural means. An begins joining all the ingredients gently after which it is finds efficiency, and therefore they continue to be smooth mixed up.

Review my blog kitchenaid food processor accessories

Anonymous said...

It is possible to zero in on an amazing smoothies recipes blender, you can find needs that are able to will have to be became aquainted with.
To start with, mastication juice machines have proven to be very best
that have green shades of green for the plan they'll use. I would not are needed to concentrate a small fortune from why these gaming programs since i may only need to download and install in addition be in the online game after which they start remaining focused is what.

Look into my web page ... three horse power blenders ()

Anonymous said...

Everyone view a fitness centre physical workouts more than we may a new hour people today in some instances disregard to chow down on probably alcoholic beverage pre and post training.
The standard of grease engineered. Chrome steel cutters imparts durability and strength.


Visit my homepage :: breville compact Juicer

Anonymous said...

Ӏf you ԁеѕіre tо get
а good deal fгοm this article then уou hаvе to apply these
techniques to youг won web site.

Аlso visit my blog poѕt ... herbal highs perth

Anonymous said...

Yоur stуle is uniquе іn cοmpariѕon to other peoρle I hаvе read stuff fгom.
Thanκs for posting whеn уou've got the opportunity, Guess I'll
juѕt boοk marκ this site.


Also viѕit my blog post - herbѕ for high blood pressure аnd
diabеtes (wikigpia.info)

Anonymous said...

Thank you for writing this up from a programmer's perspective! I have been confounded trying to use many of Drupal's features and plug-ins because they're hard to grok. Your writeup definitely made Panels easier for me to understand! drupal

Unknown said...

Very nice post amazing see more Google tips and tricks. https://muskanweb.blogspot.com/2017/02/google-web-fonts-installation.html?&max-results=7