PHP code example of justintadlock / hybrid-font

1. Go to this page and download the library: Download justintadlock/hybrid-font library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

justintadlock / hybrid-font example snippets


if ( file_exists( get_parent_theme_file_path( 'vendor/autoload.php' ) ) ) {
	



add_action( 'wp_enqueue_scripts', function() {

	Hybrid\Font\enqueue( 'themeslug', [
		'family' => [
			'roboto'      => 'Roboto:400,400i,700,700i',
			'roboto-slab' => 'Roboto+Slab:400,700'
		],
		'subset' => [
			'latin',
			'latin-ext'
		]
	] );

} );

// Register and load a font stylesheet.
enqueue( $handle, $args = [] );

// Register a font stylesheet.
register( $handle, $args = [] );

// Build a font stylesheet URL.
url( $handle, $args = [] );