-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfunctions.php
More file actions
54 lines (35 loc) · 1.5 KB
/
functions.php
File metadata and controls
54 lines (35 loc) · 1.5 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
<?php
//THEME SUPPORTS
add_action( 'after_setup_theme', function(){
add_theme_support( 'title-tag' );
add_theme_support( 'post-thumbnails' );
});
//THEME EXTRAS
//require_once get_template_directory() . '/inc/post-types.php';
//require_once get_template_directory() . '/inc/spa.php';
//require_once get_template_directory() . '/inc/ajax.php';
require_once get_template_directory() . '/inc/theme-image.php';
//THEME MENUS
add_action( 'after_setup_theme', 'theme_register_nav_menu' );
function theme_register_nav_menu() {
register_nav_menu( 'main', 'Top Menu' );
}
//THEME STYLES & SCRIPTS
add_action( 'wp_enqueue_scripts', 'theme_styles_and_scripts' );
function theme_styles_and_scripts() {
$ver = '0.01';
$css_url = get_template_directory_uri() . '/css/';
$js_url = get_template_directory_uri() . '/js/';
//Enqueue main theme style
wp_enqueue_style( 'css-main', get_stylesheet_uri(), array(), $ver);
//Enqueue additional .css files
wp_enqueue_style( 'css-variables', $css_url . 'variables.css', array(), $ver);
wp_enqueue_style( 'css-normalize', $css_url . 'normalize.css', array(), $ver);
//Enqueue .js files
wp_enqueue_script( 'main-js', $js_url . 'main.js', array('jquery'), $ver);
}
//ENABLING - DISABLING GUTENBERG FOR CERTAIN POST TYPES
add_filter( 'use_block_editor_for_post_type', 'theme_gutenberg_support_for_post_types', 10, 2 );
function theme_gutenberg_support_for_post_types( $use_block_editor, $post_type ){
if ($post_type == 'post') { return true; } else { return false; }
}