/
functions.php
executable file
·127 lines (99 loc) · 4.84 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
<?php
/*-----------------------------------------------------------------------------------*/
/* Start WooThemes Functions - Please refrain from editing this section */
/*-----------------------------------------------------------------------------------*/
// Set path to WooFramework and theme specific functions
$functions_path = TEMPLATEPATH . '/functions/';
$includes_path = TEMPLATEPATH . '/includes/';
$custom_functions_path = TEMPLATEPATH . '/customs/functions/';
// Don't load alt stylesheet from WooFramework
if (!function_exists( 'woo_output_alt_stylesheet')) {
function woo_output_alt_stylesheet() {}
}
// WooFramework
require_once ($functions_path . 'admin-init.php'); // Framework Init
if (get_option('woo_woo_tumblog_switch') == 'true') {
//Enable Tumblog Functionality and theme is upgraded
update_option('woo_needs_tumblog_upgrade', 'false');
update_option('tumblog_woo_tumblog_upgraded', 'true');
update_option('tumblog_woo_tumblog_upgraded_posts_done', 'true');
require_once ($functions_path . 'admin-tumblog-quickpress.php'); // Tumblog Dashboard Functionality
}
/*-----------------------------------------------------------------------------------*/
/* Load the theme-specific files, with support for overriding via a child theme.
/*-----------------------------------------------------------------------------------*/
$includes = array(
'includes/theme-options.php', // Options panel settings and custom settings
'includes/theme-functions.php', // Custom theme functions
'includes/theme-plugins.php', // Theme specific plugins integrated in a theme
'includes/theme-actions.php', // Theme actions & user defined hooks
'includes/theme-comments.php', // Custom comments/pingback loop
'includes/theme-js.php', // Load JavaScript via wp_enqueue_script
'includes/sidebar-init.php', // Initialize widgetized areas
'includes/theme-widgets.php' // Theme widgets
);
// Theme-Specific
$includes[] = 'includes/theme-advanced.php'; // Advanced Theme Functions
$includes[] = 'includes/theme-shortcodes.php'; // Custom theme shortcodes
// Modules
$includes[] = 'includes/woo-layout/woo-layout.php';
$includes[] = 'includes/woo-meta/woo-meta.php';
$includes[] = 'includes/woo-hooks/woo-hooks.php';
// Allow child themes/plugins to add widgets to be loaded.
$includes = apply_filters( 'woo_includes', $includes );
foreach ( $includes as $i ) {
locate_template( $i, true );
}
if (get_option('woo_woo_tumblog_switch') == 'true') {
define( 'WOOTUMBLOG_ACTIVE', true ); // Define a constant for use in our theme's templating engine.
require_once ($includes_path . 'tumblog/theme-tumblog.php'); // Tumblog Output Functions
// Test for Post Formats
if (get_option('woo_tumblog_content_method') == 'post_format') {
// Tumblog Post Format Class
require_once( $includes_path . 'tumblog/wootumblog_postformat.class.php' );
} else {
// Tumblog Custom Taxonomy Class
require_once ($includes_path . 'tumblog/theme-custom-post-types.php'); // Custom Post Types and Taxonomies
}
// Test for Post Formats
if (get_option('woo_tumblog_content_method') == 'post_format') {
//Tumblog Post Formats
global $woo_tumblog_post_format;
$woo_tumblog_post_format = new WooTumblogPostFormat();
if ( $woo_tumblog_post_format->woo_tumblog_upgrade_existing_taxonomy_posts_to_post_formats()) {
update_option('woo_tumblog_post_formats_upgraded','true');
}
}
}
// Output stylesheet and custom.css after Canvas custom styling
remove_action('wp_head', 'woothemes_wp_head');
add_action('woo_head', 'woothemes_wp_head');
if (get_option('woo_woo_tumblog_switch') == 'true' && get_option('woo_custom_rss') == 'true') {
add_filter('the_excerpt_rss', 'woo_custom_tumblog_rss_output');
add_filter('the_content_rss', 'woo_custom_tumblog_rss_output');
}
/*-----------------------------------------------------------------------------------*/
/* You can add custom functions below */
/*-----------------------------------------------------------------------------------*/
function custom_excerpt_length( $length ) {
return 30;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function sos_allow_rel() {
global $allowedtags;
$allowedtags['a']['rel'] = array ();
}
add_action( 'wp_loaded', 'sos_allow_rel' );
function sos_add_google_profile( $contactmethods ) {
// Add Google Profiles
$contactmethods['google_profile'] = 'Google Profile URL';
return $contactmethods;
}
add_filter( 'user_contactmethods', 'sos_add_google_profile', 10, 1);
#SoS to override the archives widget
require_once('sos_functions-widgets.php');
require_once($custom_functions_path . 'custom_function.php');
/*-----------------------------------------------------------------------------------*/
/* Don't add any code below here or the sky will fall down */
/*-----------------------------------------------------------------------------------*/
?>