forked from gpspake/grunterie
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfunctions.php
131 lines (110 loc) · 4.86 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
<?php
/*
Author: Zhen Huang
URL: http://themefortress.com/
This place is much cleaner. Put your theme specific codes here,
anything else you may want to use plugins to keep things tidy.
*/
/*
1. lib/clean.php
- head cleanup
- post and images related cleaning
*/
require_once( get_template_directory() . '/lib/clean.php'); // do all the cleaning and enqueue here
/*
2. lib/enqueue-style.php
- enqueue Foundation and Reverie CSS
*/
require_once( get_template_directory() . '/lib/enqueue-style.php');
/*
3. lib/foundation.php
- add pagination
*/
require_once( get_template_directory() . '/lib/foundation.php'); // load Foundation specific functions like top-bar
/*
4. lib/nav.php
- custom walker for top-bar and related
*/
require_once( get_template_directory() . '/lib/nav.php'); // filter default wordpress menu classes and clean wp_nav_menu markup
/*
5. lib/presstrends.php
- add PressTrends, tracks how many people are using Reverie
*/
require_once( get_template_directory() . '/lib/presstrends.php'); // load PressTrends to track the usage of Reverie across the web, comment this line if you don't want to be tracked
require_once( get_template_directory() . '/lib/relative-urls.php'); // Root relative URLs
/****************************************
Require Plugins
*****************************************/
require_once( get_template_directory() . '/lib/class-tgm-plugin-activation.php' );
require_once( get_template_directory() . '/lib/theme-require-plugins.php' );
add_action( 'tgmpa_register', 'reverie_register_required_plugins' );
/**********************
Add theme supports
**********************/
if( ! function_exists( 'reverie_theme_support' ) ) {
function reverie_theme_support() {
// Add language supports.
load_theme_textdomain('reverie', get_template_directory() . '/lang');
// Add post thumbnail supports. http://codex.wordpress.org/Post_Thumbnails
add_theme_support('post-thumbnails');
// set_post_thumbnail_size(150, 150, false);
add_image_size('fd-lrg', 1020, 99999);
add_image_size('fd-lrg-med', 910, 9999);
add_image_size('fd-med-lrg', 680, 99999);
add_image_size('fd-med-sm', 420, 99999);
add_image_size('fd-sm', 260, 9999);
// rss thingy
add_theme_support('automatic-feed-links');
// Enable relative URLs
add_theme_support('root-relative-urls');
// Add post formats support. http://codex.wordpress.org/Post_Formats
add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat'));
// Add menu support. http://codex.wordpress.org/Function_Reference/register_nav_menus
add_theme_support('menus');
register_nav_menus(array(
'primary' => __('Primary Navigation', 'reverie'),
'additional' => __('Additional Navigation', 'reverie'),
'utility' => __('Utility Navigation', 'reverie')
));
// Add custom background support
add_theme_support( 'custom-background',
array(
'default-image' => '', // background image default
'default-color' => '', // background color default (dont add the #)
'wp-head-callback' => '_custom_background_cb',
'admin-head-callback' => '',
'admin-preview-callback' => ''
)
);
}
}
add_action('after_setup_theme', 'reverie_theme_support'); /* end Reverie theme support */
// create widget areas: sidebar, footer
$sidebars = array('Sidebar');
foreach ($sidebars as $sidebar) {
register_sidebar(array('name'=> $sidebar,
'id' => 'Sidebar',
'before_widget' => '<article id="%1$s" class="panel widget %2$s">',
'after_widget' => '</article>',
'before_title' => '<h4>',
'after_title' => '</h4>'
));
}
$sidebars = array('Footer');
foreach ($sidebars as $sidebar) {
register_sidebar(array('name'=> $sidebar,
'id' => 'Footer',
'before_widget' => '<div class="large-4 columns"><article id="%1$s" class="panel widget %2$s">',
'after_widget' => '</article></div>',
'before_title' => '<h4>',
'after_title' => '</h4>'
));
}
// return entry meta information for posts, used by multiple loops, you can override this function by defining them first in your child theme's functions.php file
if ( ! function_exists( 'reverie_entry_meta' ) ) {
function reverie_entry_meta() {
echo '<span itemprop="author" itemscope="itemscope" itemtype="http://schema.org/Person" class="byline author">'. __('Written by', 'reverie') .' <a itemprop="url" href="'. get_author_posts_url(get_the_author_meta('ID')) .'" rel="author" class="fn" itemprop="name">'. get_the_author() .', </a></span>';
echo '<time class="updated" itemprop="datePublished" datetime="'. get_the_time('c') .'" pubdate>'. get_the_time('F jS, Y') .'</time>';
}
};
?>