-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfunctions.php
87 lines (81 loc) · 2.69 KB
/
functions.php
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
<?php
/*
// Load main css for parent and child theme (only needed if we don't want to build a new style.css file)
add_action('wp_enqueue_scripts', 'my_theme_enqueue_styles');
function my_theme_enqueue_styles()
{
$parenthandle = 'ct-author-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
$theme = wp_get_theme();
// Parent theme css
wp_enqueue_style($parenthandle,
get_template_directory_uri() . '/style.min.css',
array(), // If the parent theme code has a dependency, copy it to here.
$theme->parent()->get('Version')
);
// Child theme css
wp_enqueue_style('child-style',
get_stylesheet_uri(),
array($parenthandle),
$theme->get('Version') // This only works if you have Version defined in the style header.
);
}
*/
// Minify CSS
add_action('wp_print_styles', 'ckt_minify_css', 20);
function ckt_minify_css()
{
// Remove parent theme css
wp_dequeue_style('ct-author-style');
// Add child theme css
wp_enqueue_style(
'author-child-style',
get_stylesheet_directory_uri() . '/style.min.css',
array(),
wp_get_theme()->get('Version')
);
}
// Remove fonts from parent theme
add_action('wp_print_styles', 'ckt_remove_parent_styles', 20);
function ckt_remove_parent_styles()
{
// Google fonts
wp_dequeue_style('ct-author-google-fonts');
// Font Awesome
wp_dequeue_style('ct-author-font-awesome');
}
// Customize footer
function author_footer_callback()
{
return empty(get_bloginfo('description')) ? get_bloginfo('name') : get_bloginfo('name') . " | " . get_bloginfo('description');
}
add_filter('ct_author_footer_text', 'author_footer_callback');
//Remove Gutenberg Block Library CSS from loading on the frontend
function remove_wp_block_library_css()
{
wp_dequeue_style('wp-block-library');
wp_dequeue_style('wp-block-library-theme');
}
add_action('wp_print_styles', 'remove_wp_block_library_css', 100);
/**
* This function will connect wp_mail to your authenticated
* SMTP server. This improves reliability of wp_mail, and
* avoids many potential problems.
*
* For instructions on the use of this script, see:
* https://butlerblog.com/easy-smtp-email-wordpress-wp_mail/
*
* Values for constants are set in wp-config.php
*/
add_action('phpmailer_init', 'send_smtp_email');
function send_smtp_email($phpmailer)
{
$phpmailer->isSMTP();
$phpmailer->Host = SMTP_HOST;
$phpmailer->SMTPAuth = SMTP_AUTH;
$phpmailer->Port = SMTP_PORT;
$phpmailer->Username = SMTP_USER;
$phpmailer->Password = SMTP_PASS;
$phpmailer->SMTPSecure = SMTP_SECURE;
$phpmailer->From = SMTP_FROM;
$phpmailer->FromName = SMTP_NAME;
}