forked from wp-blocks/modul-r
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
107 lines (87 loc) · 3.22 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
// Modul-R defaults
$modul_r_defaults = array(
'colors' => array(
'primary' => '#17BEBB',
'secondary' => '#33658A',
'header' => '#323439',
'white' => '#ffffff',
'white-smoke' => '#f3f3f3',
'gray-light' => '#e3e3e3',
'gray' => '#888888',
'gray-dark' => '#4e4e4e',
'black' => '#222222',
),
);
if ( ! function_exists('modul_r_theme_setup') ) :
function modul_r_theme_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
*/
load_theme_textdomain( 'modul-r', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* WordPress define content width
* https://codex.wordpress.org/Content_Width
*/
if ( ! isset( $content_width ) ) $content_width = 900;
/*
* Enable support for Post Thumbnails on posts and pages.
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 400, 9999 );
add_image_size( 'modul-r-fullwidth', 1920, 9999 ); // 1920px width & unlimited height
// This theme uses wp_nav_menu() in Primary Navigation.
register_nav_menus( array(
'main-menu' => esc_html__( 'Primary', 'modul-r' )
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support(
'html5',
array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
)
);
// Add support for core custom logo, header text color, website background.
add_theme_support( 'custom-logo' );
add_theme_support( 'custom-header', array( 'default-text-color' => '#f3f3f3' ) );
add_theme_support( 'custom-background', array( 'default-color' => '#fcfcfc' ) );
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// Add support for Block Styles.
add_theme_support( 'wp-block-styles' );
// Add support for full and wide align images.
add_theme_support( 'align-wide' );
// Add support for editor styles.
add_theme_support( 'editor-styles' );
// Enqueue editor styles and fonts.
add_editor_style( 'assets/dist/css/editor.css' );
add_editor_style( 'https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700|Material+Icons' ); // todo: make this dynamic
// Add support for responsive embedded content.
add_theme_support( 'responsive-embeds' );
}
endif;
add_action( 'after_setup_theme', 'modul_r_theme_setup' );
require_once( get_template_directory() . '/inc/customizer.php' );
require_once( get_template_directory() . '/inc/woocommerce.php' );
require_once( get_template_directory() . '/inc/sidebar.php' );
require_once( get_template_directory() . '/inc/masonry.php' );
require_once( get_template_directory() . '/inc/enqueue-scripts.php' );
require_once( get_template_directory() . '/inc/template-functions.php' );