Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function gfont_code( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'class' => 'gfont',
- ), $atts ) );
- return '<div style=" font-family: ' . esc_attr($class) . ' , serif";>' . $content . '</div>';
- }
- add_shortcode('gfont','gfont_code');
- function load_gfont() {
- wp_register_script( 'googlefont', 'http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js');
- wp_enqueue_script( 'googlefont' );
- }
- add_action('init', 'load_gfont');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement