-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
139 lines (102 loc) · 3.93 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
/**
* Minimal artist functions and definitions
*
* Set up the theme and provides some helper functions, which are used in the
* theme as custom template tags. Others are attached to action and filter
* hooks in WordPress to change core functionality.
*
* When using a child theme you can override certain functions (those wrapped
* in a function_exists() call) by defining them first in your child theme's
* functions.php file. The child theme's functions.php file is included before
* the parent theme's file, so the child theme functions would be used.
*
* @link http://codex.wordpress.org/Theme_Development
* @link http://codex.wordpress.org/Child_Themes
*
* Functions that are not pluggable (not wrapped in function_exists()) are
* instead attached to a filter or action hook.
*
* For more information on hooks, actions, and filters,
* @link http://codex.wordpress.org/Plugin_API
*
*/
// Set content width value based on the theme's design
if ( ! isset( $content_width ) )
$content_width = 900;
function minart_theme_features() {
global $wp_version;
// Add theme support for title tag
add_theme_support( 'title-tag' );
// Add theme support for Automatic Feed Links
add_theme_support( 'automatic-feed-links' );
// Add theme support for Featured Images
add_theme_support( 'post-thumbnails' );
// Set custom thumbnail dimensions
set_post_thumbnail_size( 400, 300, true );
// Add theme support for Custom Background
$background_args = array(
'default-color' => '',
'default-image' => '',
'wp-head-callback' => '_custom_background_cb',
'admin-head-callback' => '',
'admin-preview-callback' => '',
);
add_theme_support( 'custom-background', $background_args );
//register header menu
register_nav_menu( 'header-menu', __('Header Menu', 'minart') );
// Add theme support for Semantic Markup
$markup = array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', );
add_theme_support( 'html5', $markup );
// Add theme support for Translation
load_theme_textdomain( 'minart', get_template_directory() . '/languages' );
}
// Hook into the 'after_setup_theme' action
add_action( 'after_setup_theme', 'minart_theme_features' );
// widget area
function minart_widgets_init() {
register_sidebar( array(
'name' => __('Right sidebar', 'minart'),
'id' => 'rightside',
'before_widget' => '<aside id="%1$s" class="cf widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widgetit">',
'after_title' => '</h2>',
) );
register_sidebar( array(
'name' => __('Footer widgets', 'minart'),
'id' => 'footerwidg',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widgetit">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'minart_widgets_init' );
// make search submit screen-reader-only
function minart_mod_searchsubmit( $html ) {
return str_replace( 'class="search-submit"', 'class="search-submit screen-reader-text"', $html );
}
add_filter( 'get_search_form', 'minart_mod_searchsubmit' );
// includes
require get_template_directory() . '/inc/customizer.php';
// load custom font from google fonts
function minart_load_fonts() {
wp_register_style('googleFonts', 'http://fonts.googleapis.com/css?family=Raleway:600,700');
wp_enqueue_style( 'googleFonts');
}
add_action('wp_print_styles', 'minart_load_fonts');
// add editor style
function minart_editor_styles() {
add_editor_style( '/css/editor-style.css' );
}
add_action( 'init', 'minart_editor_styles' );
//enqueue scripts
function minart_scripts() {
wp_enqueue_style( 'minart-style', get_stylesheet_uri() );
wp_enqueue_script( 'minart-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20140825', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'minart_scripts' );