css - Include several google fonts in a WordPress theme and allow user to select them -


i'm developing wordpress theme , need include several google fonts (may 10) in theme , it's user select font used headings, paragraphs , other elements.

i've option page in back-end , there user able select them.

so, question how enqueue fonts in theme. enqueuing fonts @ once normal enqueuing way cause performance issues , slow down site.

so, should use condition in functions page enguing script goes ?

(the following code not real one.)

if($options['font'] == "open-sans"){     enque "open-sans" }else if($options['font'] == "some-font1"){     enque "some-font" }else if(){ ...................... ...................... ...................... } 

or there other way ?


Comments