Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

font

By: a guest on Aug 4th, 2011  |  syntax: PHP  |  size: 0.49 KB  |  views: 147  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. function gfont_code( $atts, $content = null ) {
  3.    extract( shortcode_atts( array(
  4.       'class' => 'gfont',
  5.       ), $atts ) );
  6.  
  7.    return '<div style=" font-family: ' . esc_attr($class) . ' , serif";>' . $content . '</div>';
  8. }
  9. add_shortcode('gfont','gfont_code');
  10. function load_gfont() {
  11.    
  12.     wp_register_script( 'googlefont', 'http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js');
  13.     wp_enqueue_script( 'googlefont' );
  14. }    
  15. add_action('init', 'load_gfont');
  16. ?>
clone this paste RAW Paste Data