This repository has been archived by the owner on Apr 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathfunctions.php
87 lines (80 loc) · 1.89 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
/**
* Functions and definitions
*
*/
/*
* Let WordPress manage the document title.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*/
add_theme_support( 'post-thumbnails' );
/*
* 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',
) );
/**
* Include primary navigation menu
*/
function untheme_nav_init() {
register_nav_menus( array(
'menu-1' => 'Primary Menu',
) );
}
add_action( 'init', 'untheme_nav_init' );
/**
* Register widget area.
*
*/
function untheme_widgets_init() {
register_sidebar( array(
'name' => 'Sidebar',
'id' => 'sidebar-1',
'description' => 'Add widgets',
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'untheme_widgets_init' );
/**
* Enqueue scripts and styles.
*/
function untheme_scripts() {
wp_enqueue_style( 'untheme-style', get_stylesheet_uri() );
wp_enqueue_style( 'untheme-custom-style', get_template_directory_uri() . '/assets/css/style.css' );
wp_enqueue_script( 'untheme-scripts', get_template_directory_uri() . '/assets/js/scripts.js' );
}
add_action( 'wp_enqueue_scripts', 'untheme_scripts' );
function untheme_create_post_custom_post() {
register_post_type('custom_post',
array(
'labels' => array(
'name' => __('Custom Post', 'untheme'),
),
'public' => true,
'hierarchical' => true,
'supports' => array(
'title',
'editor',
'excerpt',
'custom-fields',
'thumbnail',
),
'taxonomies' => array(
'post_tag',
'category',
)
));
}
add_action('init', 'untheme_create_post_custom_post'); // Add our work type