-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
83 lines (71 loc) · 1.82 KB
/
Copy pathfunctions.php
File metadata and controls
83 lines (71 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* Functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package trailhead-landing
* @since 1.0.0
*/
/**
* The theme version.
*
* @since 1.0.0
*/
define( 'TRAILHEAD_LANDING_VERSION', wp_get_theme()->get( 'Version' ) );
define( 'TRAILHEAD_LANDING_URL', get_template_directory_uri() );
define( 'TRAILHEAD_LANDING_PATH', get_theme_file_path() );
/**
* Add theme support for block styles and editor style.
*
* @since 1.0.0
*
* @return void
*/
function trailhead_landing_setup() {
add_editor_style( 'admin-style.css' );
/*
* Load additional block styles.
* See details on how to add more styles in the readme.txt.
*/
$styled_blocks = array(
'navigation',
);
foreach ( $styled_blocks as $block_name ) {
$args = array(
'handle' => "trailhead-landing-$block_name",
'src' => get_theme_file_uri( "assets/css/blocks/$block_name.min.css" ),
'path' => get_theme_file_path( "assets/css/blocks/$block_name.min.css" ),
);
// Replace the "core" prefix if you are styling blocks from plugins.
wp_enqueue_block_style( "core/$block_name", $args );
}
}
add_action( 'after_setup_theme', 'trailhead_landing_setup' );
/**
* Enqueue the CSS files.
*
* @since 1.0.0
*
* @return void
*/
function trailhead_landing_styles() {
wp_enqueue_style(
'trailhead-landing-style',
get_template_directory_uri() . '/style.css',
array(),
TRAILHEAD_LANDING_VERSION
);
}
function trailhead_landing_editor_styles() {
wp_enqueue_style(
'falls-co-admin-styles',
get_template_directory_uri() . '/admin-style.css',
array(),
TRAILHEAD_LANDING_VERSION
);
}
add_action( 'admin_enqueue_scripts', 'trailhead_landing_editor_styles' );
add_action( 'wp_enqueue_scripts', 'trailhead_landing_styles' );
// Blocks
require_once get_theme_file_path( 'inc/register-blocks.php' );