2020-07-29 18:26:17 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Ibis functions and definitions
|
|
|
|
*
|
|
|
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage seedlet_blocks
|
|
|
|
* @since 1.0.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
if ( ! function_exists( 'ibis_setup' ) ) :
|
|
|
|
/**
|
|
|
|
* Sets up theme defaults and registers support for various WordPress features.
|
|
|
|
*
|
|
|
|
* Note that this function is hooked into the after_setup_theme hook, which
|
|
|
|
* runs before the init hook. The init hook is too late for some features, such
|
|
|
|
* as indicating support for post thumbnails.
|
|
|
|
*/
|
|
|
|
function ibis_setup() {
|
|
|
|
// Add support for editor styles.
|
|
|
|
add_theme_support( 'editor-styles' );
|
|
|
|
|
|
|
|
// Enqueue editor styles.
|
2020-07-30 17:49:41 +00:00
|
|
|
add_editor_style( get_stylesheet_directory_uri() . '/style-editor.css' );
|
2020-07-29 18:26:17 +00:00
|
|
|
}
|
|
|
|
endif;
|
2020-07-30 17:49:41 +00:00
|
|
|
add_action( 'after_setup_theme', 'ibis_setup', 999 );
|
2020-07-29 18:26:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add Google webfonts
|
|
|
|
*
|
|
|
|
* http://themeshaper.com/2014/08/13/how-to-add-google-fonts-to-wordpress-themes/
|
|
|
|
*/
|
|
|
|
function ibis_fonts_url() {
|
|
|
|
|
|
|
|
$fonts_url = '';
|
|
|
|
|
|
|
|
/* Translators: If there are characters in your language that are not
|
|
|
|
* supported by Lora, translate this to 'off'. Do not translate
|
|
|
|
* into your own language.
|
|
|
|
*/
|
2020-07-30 17:49:41 +00:00
|
|
|
$lora = esc_html_x( 'on', 'Lora font: on or off', 'ibis' );
|
2020-07-29 18:26:17 +00:00
|
|
|
|
2020-07-30 17:49:41 +00:00
|
|
|
if ( 'off' !== $lora ) {
|
2020-07-29 18:26:17 +00:00
|
|
|
$font_families = array();
|
|
|
|
|
|
|
|
$font_families[] = 'Lora:400,400i,600,600i,700,700i';
|
|
|
|
|
2021-02-18 15:20:38 +00:00
|
|
|
/**
|
|
|
|
* A filter to enable child themes to add/change/omit font families.
|
|
|
|
*
|
|
|
|
* @param array $font_families An array of font families to be imploded for the Google Font API
|
|
|
|
*/
|
|
|
|
$font_families = apply_filters( 'included_google_font_families', $font_families );
|
|
|
|
|
2020-07-29 18:26:17 +00:00
|
|
|
$query_args = array(
|
|
|
|
'family' => urlencode( implode( '|', $font_families ) ),
|
|
|
|
'subset' => urlencode( 'latin,latin-ext' ),
|
|
|
|
);
|
|
|
|
|
|
|
|
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
|
|
|
|
}
|
|
|
|
|
|
|
|
return esc_url_raw( $fonts_url );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enqueue scripts and styles.
|
|
|
|
*/
|
|
|
|
function ibis_enqueue() {
|
|
|
|
wp_enqueue_style( 'ibis-styles', get_stylesheet_uri() );
|
|
|
|
|
|
|
|
// enqueue Google fonts
|
|
|
|
wp_enqueue_style( 'mayland-fonts', ibis_fonts_url(), array(), null );
|
|
|
|
|
|
|
|
}
|
2021-02-18 10:17:16 +00:00
|
|
|
add_action( 'wp_enqueue_scripts', 'ibis_enqueue' );
|