/
functions.php
executable file
·84 lines (70 loc) · 3.09 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
<?php
/**
* @package WordPress
* @subpackage Anubis
* @since 1.0
*/
// includes
include_once('inc/rest/menu.php');
include_once('inc/taxonomies/skills.php');
include_once('inc/post-types/websites.php');
include_once('inc/post-types/work-history.php');
include_once('inc/post-types/projects.php');
// disable wp-embed
function disable_wp_embed(){
wp_deregister_script( 'wp-embed' );
}
add_action( 'wp_footer', 'disable_wp_embed' );
// disable admin bar
add_filter('show_admin_bar', '__return_false');
// meta tags
function add_meta_tags() {
echo '<title>Hasani Rogers | Web Developer</title>';
echo '<meta name="author" content="Hasani Rogers">';
echo '<meta name="title" content="Hasani Rogers | Web Developer">';
echo '<meta name="description" content="My name is Hasani Rogers and I\'m a web developer who operates out of the Metro Detroit area in Michigan." />';
echo '<meta name="viewport" content="width=device-width, initial-scale=1">';
echo '<meta property="og:type" content="website">';
echo '<meta property="og:url" content="https://hasanirogers.me">';
echo '<meta property="og:title" content="Hasani Rogers | Web Developer">';
echo '<meta property="og:description" content="My name is Hasani Rogers and I\'m a web developer who operates out of the Metro Detroit area in Michigan.">';
echo '<meta property="og:image" content="https://contact.hasanirogers.me/images/avatar.jpeg">';
echo '<meta property="twitter:card" content="summary_large_image">';
echo '<meta property="twitter:url" content="https://hasanirogers.me">';
echo '<meta property="twitter:title" content="Hasani Rogers | Web Developer">';
echo '<meta property="twitter:description" content="My name is Hasani Rogers and I\'m a web developer who operates out of the Metro Detroit area in Michigan.">';
echo '<meta property="twitter:image" content="https://contact.hasanirogers.me/images/avatar.jpeg">';
echo '<base href="/">';
}
add_action('wp_head', 'add_meta_tags', '1');
// disable meta tag
remove_action('wp_head', 'wp_generator');
// feature image support
add_theme_support( 'post-thumbnails', array( 'projects') );
// enqueue fonts
function add_fonts() {
wp_enqueue_style( 'ubuntu-font', 'https://fonts.googleapis.com/css?family=Ubuntu', false );
}
add_action( 'wp_enqueue_scripts', 'add_fonts' );
// enqueue font end bundles
if (!is_admin()) {
wp_enqueue_style('bundle-css', get_theme_file_uri('/bundles/frontend.css'));
wp_enqueue_script('bundle-js', get_theme_file_uri('/bundles/frontend.js'), array(), false, true);
}
// enqueue admin bundles
if (is_admin()) {
wp_enqueue_style('admin-css', get_theme_file_uri('/bundles/admin.css'));
wp_enqueue_script('admin-js', get_theme_file_uri('/bundles/admin.js'), array('wp-blocks', 'wp-editor', 'wp-components'), false, true);
}
// not having this causes a redirect loop on prod for some reason
remove_filter('template_redirect', 'redirect_canonical');
// menus
function me_register_menus() {
register_nav_menus(
array(
'hamburger-menu' => __( 'Hamburger Menu'),
'footer-menu' => __( 'Footer Menu' ),
)
);
}
add_action( 'init', 'me_register_menus' );