-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
53 lines (40 loc) · 1.49 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
<?php
/**
* WordPress Theme
*/
// Define text domain for translations
define('TXT_DOMAIN', 'WP_THEME');
// Composer autoloader
if( file_exists( __DIR__ . '/vendor/autoload.php' ) ){
require_once __DIR__ . '/vendor/autoload.php';
// Setup mustache php template engine
$mustacheEngine = new Mustache_Engine(array(
'loader' => new Mustache_Loader_FilesystemLoader(dirname(__FILE__) . '/tpls'),
'entity_flags' => ENT_QUOTES
));
}
add_action( 'after_setup_theme', function(){
// Load text domain and lang dir
load_theme_textdomain( TXT_DOMAIN, get_template_directory() . '/languages' );
// Load custom editor styles (default: editor-style.css)
add_theme_support('editor-styles');
add_editor_style();
// Add support for post thumbnails
add_theme_support( 'post-thumbnails' );
// Add excerpt support for pages
add_post_type_support( 'page', 'excerpt' );
// Add support for align wide blocks
add_theme_support( 'align-wide' );
// Add custom image sizes
add_image_size( 'thumb@2x', 300, 300, true );
add_image_size( 'medium@2x', 600, 600, false );
add_image_size( 'large@2x', 2048, 2048, false );
// Register navs
register_nav_menus(array(
'primary' => __( 'Primary nav', TXT_DOMAIN ),
'secondary' => __( 'Secondary nav', TXT_DOMAIN ),
'tertiary' => __( 'Tertiary nav', TXT_DOMAIN ),
'quaternary' => __( 'Quaternary nav', TXT_DOMAIN )
));
});
?>