Skip to content

Commit

Permalink
readme tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Sep 25, 2020
1 parent 5bf540a commit 2a99194
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@ A WordPress theme will typically enqueue assets using the [`wp_enqueue_style`](h
```php
function my_theme_enqueue_assets() {
// Load the theme stylesheet.
wp_enqueue_style( 'my-theme', get_stylesheet_directory_uri() . '/style.css', array(), '1.0' );
wp_enqueue_style(
'my-theme',
get_stylesheet_directory_uri() . '/style.css',
array(),
'1.0'
);
// Load the webfont.
wp_enqueue_style( 'literata', 'https://fonts.googleapis.com/css2?family=Literata&display=swap', array(), '1.0' );
wp_enqueue_style(
'literata',
'https://fonts.googleapis.com/css2?family=Literata&display=swap',
array(),
'1.0'
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_assets' );
```
Expand All @@ -24,9 +34,17 @@ function my_theme_enqueue_assets() {
// Include the file.
require_once get_theme_file_path( 'inc/wptt-webfont-loader.php' );
// Load the theme stylesheet.
wp_enqueue_style( 'my-theme', get_stylesheet_directory_uri() . '/style.css', array(), '1.0' );
wp_enqueue_style(
'my-theme',
get_stylesheet_directory_uri() . '/style.css',
array(),
'1.0'
);
// Load the webfont.
wp_add_inline_style( 'my-theme', wptt_get_webfont_styles( 'https://fonts.googleapis.com/css2?family=Literata&display=swap' ) );
wp_add_inline_style(
'my-theme',
wptt_get_webfont_styles( 'https://fonts.googleapis.com/css2?family=Literata&display=swap' )
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_assets' );
```
Expand Down

0 comments on commit 2a99194

Please sign in to comment.