get( 'Version' ) ); // Add styles inline. wp_add_inline_style( 'baboon-style', baboon_get_font_face_styles() ); // Enqueue theme stylesheet. wp_enqueue_style( 'baboon-style' ); } } add_action( 'wp_enqueue_scripts', 'baboon_styles' ); if ( ! function_exists( 'baboon_editor_styles' ) ) { // Enqueue editor styles. function baboon_editor_styles() { // Add styles inline. wp_add_inline_style( 'wp-block-library', baboon_get_font_face_styles() ); add_editor_style( get_template_directory_uri() . '/assets/css/theme.min.css' ); } } add_action( 'admin_init', 'baboon_editor_styles' ); // Get font face styles. if ( ! function_exists( 'baboon_get_font_face_styles' ) ) { function baboon_get_font_face_styles() { return " @font-face{ font-family: 'Bebas Neue'; font-weight: 100; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/BebasNeue-Regular.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Bebas Neue'; font-weight: 200; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/BebasNeue-Regular.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Bebas Neue'; font-weight: 300; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/BebasNeue-Regular.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Bebas Neue'; font-weight: 400; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/BebasNeue-Regular.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Bebas Neue'; font-weight: 500; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/BebasNeue-Regular.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Bebas Neue'; font-weight: 600; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/BebasNeue-Regular.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Bebas Neue'; font-weight: 700; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/BebasNeue-Regular.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Bebas Neue'; font-weight: 800; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/BebasNeue-Regular.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Bebas Neue'; font-weight: 900; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/BebasNeue-Regular.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Encode Sans'; font-weight: 100; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/EncodeSans-Thin.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Encode Sans'; font-weight: 200; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/EncodeSans-ExtraLight.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Encode Sans'; font-weight: 300; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/EncodeSans-Light.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Encode Sans'; font-weight: 400; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/EncodeSans-Regular.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Encode Sans'; font-weight: 500; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/EncodeSans-Medium.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Encode Sans'; font-weight: 600; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/EncodeSans-SemiBold.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Encode Sans'; font-weight: 700; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/EncodeSans-Bold.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Encode Sans'; font-weight: 800; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/EncodeSans-ExtraBold.woff2' ) . "') format('woff2'); } @font-face{ font-family: 'Encode Sans'; font-weight: 900; font-style: normal; font-stretch: normal; font-display: swap; src: url('" . get_theme_file_uri( 'assets/fonts/EncodeSans-Black.woff2' ) . "') format('woff2'); } "; } } // Add script to Editor if ( ! function_exists( 'baboon_admin_add_scripts' ) ) { function baboon_admin_add_scripts( $hook ){ if ( 'appearance_page_baboon' != $hook ) { return; } wp_register_style( 'baboon-settings-css', get_template_directory_uri() . '/assets/css/admin.min.css' , '1.0.0' ); wp_enqueue_style( 'baboon-settings-css'); } } add_action( 'admin_enqueue_scripts', 'baboon_admin_add_scripts'); // Add admin page content get_template_part( 'inc/theme' ); // Add admin page if ( ! function_exists( 'baboon_create_menu' ) ) { add_action( 'admin_menu', 'baboon_create_menu' ); // Adds our dashboard menu item function baboon_create_menu() { add_theme_page( 'Baboon WordPress Theme', 'Baboon', 'edit_theme_options', 'baboon', 'baboon_admin_theme_page' ); } }