-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
96 lines (78 loc) · 2.48 KB
/
Copy pathfunctions.php
File metadata and controls
96 lines (78 loc) · 2.48 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
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* Momentum Academy Theme
*
* @package MomentumAcademy
*/
use MomentumAcademy\Assets_Manager;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
! defined( 'momentum_academy_THEME_FILE' ) && define( 'momentum_academy_THEME_FILE', __FILE__ );
if ( file_exists( get_theme_file_path( 'vendor/autoload.php' ) ) ) {
require_once get_theme_file_path( 'vendor/autoload.php' );
}
require_once get_theme_file_path( 'inc/constants.php' );
require_once get_theme_file_path( 'inc/admin.php' );
require_once get_theme_file_path( 'inc/theme-setup.php' );
require_once get_theme_file_path( 'inc/register_block_patterns.php' );
require_once get_theme_file_path( 'inc/assets-manager.php' );
/**
* Theme setup
*/
if ( ! function_exists( 'momentum_academy_setup' ) ) {
function momentum_academy_setup() {
add_theme_support( 'editor-styles' );
}
}
add_action( 'after_setup_theme', 'momentum_academy_setup' );
/**
* Enqueue theme stylesheet
*/
function momentum_academy_enqueue_styles() {
wp_enqueue_style(
'momentum-academy-style',
get_stylesheet_uri(),
array(),
wp_get_theme()->get( 'Version' )
);
}
add_action( 'wp_enqueue_scripts', 'momentum_academy_enqueue_styles' );
/**
* Provide default logo when none is set
*/
function momentum_academy_get_custom_logo( $html ) {
if ( ! empty( $html ) ) {
return $html;
}
$default_logo_filename = 'fse-theme-logo.png';
$default_logo_url = Assets_Manager::get_image_url( $default_logo_filename );
if ( file_exists( get_template_directory() . '/assets/images/' . $default_logo_filename ) ) {
$html = sprintf(
'<a href="%1$s" class="custom-logo-link" rel="home" aria-label="%3$s">
<img src="%2$s" class="custom-logo" alt="%3$s" width="200" height="80" />
</a>',
esc_url( home_url( '/' ) ),
esc_url( $default_logo_url ),
esc_attr( get_bloginfo( 'name' ) )
);
} else {
$html = sprintf(
'<a href="%1$s" class="custom-logo-link site-title-fallback" rel="home">%2$s</a>',
esc_url( home_url( '/' ) ),
esc_html( get_bloginfo( 'name' ) )
);
}
return $html;
}
add_filter( 'get_custom_logo', 'momentum_academy_get_custom_logo' );
/**
* Provide a default fallback tagline if the site tagline is empty.
*/
function momentum_academy_default_tagline( $blogdescription ) {
if ( empty( trim( $blogdescription ) ) ) {
return 'Join thousands of learners & explore courses from top instructors. Effortlessly to launch, manage, & grow.';
}
return $blogdescription;
}
add_filter( 'option_blogdescription', 'momentum_academy_default_tagline' );