Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 225 lines (183 sloc) 6.68 kb
6348e25 @davidtcarson Revert bac2ce018a3928b58b18f5ccabcb39b6b3537c6b^..HEAD
authored
1 <?php
2
3 /*
4 * Google Font for cursive header title. This will change for sure to make it easier for users to change.
5 */
6 add_action('wp_print_styles', 'add_googlefonts');
7 function add_googlefonts() {
8 $givemetypography = 'http://fonts.googleapis.com/css?family=Lobster+Two&v2';
9
10 wp_register_style('googlewebfonts', $givemetypography);
11 wp_enqueue_style( 'googlewebfonts');
12 }
13
14 // special thanks to Less Framework (http://lessframework.com/)
15 function go_responsive() {
16 ?>
17 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
18 <?php
19 }
20 add_action ( 'bp_head', 'go_responsive' );
21
22 function bp_dtheme_enqueue_styles() {
23 //nothing to see here
24 }
25 add_action( 'wp_print_styles', 'bp_dtheme_enqueue_styles' );
26
27 /*
28 * LessCSS for easy color changes.
29 */
30 add_action('wp_print_styles', 'add_lesscss');
31 function add_lesscss() {
32
33 wp_register_style('lesscss', get_bloginfo('stylesheet_directory') . '/css/styles.less');
34 wp_enqueue_style( 'lesscss');
35 }
36
37 add_action('init', 'add_lesscssjs');
38 function add_lesscssjs() {
39 wp_register_script( 'lesscssjs', get_bloginfo('stylesheet_directory') . '/js/less-1.1.3.min.js');
40 wp_enqueue_script( 'lesscssjs' );
41
42 }
43
44 // add rel="stylesheet/less" to any less stylesheet url
45 // from http://plugins.svn.wordpress.org/template-provisioning/tags/0.2.5/template-provisioning.php
46 add_filter('style_loader_tag', 'filter_style_link_tags_for_less_js', 10, 2);
47 function filter_style_link_tags_for_less_js($tag, $handle)
48 {
49 global $wp_styles;
50
51 // if the src ends in ".less", the rel attribute should be "stylesheet/less"
52 if (preg_match("/\.less$/", $wp_styles->registered[$handle]->src)) {
53 $tag = preg_replace("/rel=(['\"])[^'\"]*(['\"])/", "rel=$1stylesheet/less$2", $tag);
54 }
55
56 return $tag;
57 }
58
59 // This is taken from bp-default. We don't need custom header image or background style options.
60 function bp_dtheme_setup() {
61 global $bp;
62
63 // Load the AJAX functions for the theme
64 require( TEMPLATEPATH . '/_inc/ajax.php' );
65
66 // This theme styles the visual editor with editor-style.css to match the theme style.
67 add_editor_style();
68
69 // This theme uses post thumbnails
70 add_theme_support( 'post-thumbnails' );
71
72 // Add default posts and comments RSS feed links to head
73 add_theme_support( 'automatic-feed-links' );
74
75 // This theme uses wp_nav_menu() in one location.
76 register_nav_menus( array(
77 'primary' => __( 'Primary Navigation', 'buddypress' ),
78 ) );
79
80
81 if ( !is_admin() ) {
82 // Register buttons for the relevant component templates
83 // Friends button
84 if ( bp_is_active( 'friends' ) )
85 add_action( 'bp_member_header_actions', 'bp_add_friend_button' );
86
87 // Activity button
88 if ( bp_is_active( 'activity' ) )
89 add_action( 'bp_member_header_actions', 'bp_send_public_message_button' );
90
91 // Messages button
92 if ( bp_is_active( 'messages' ) )
93 add_action( 'bp_member_header_actions', 'bp_send_private_message_button' );
94
95 // Group buttons
96 if ( bp_is_active( 'groups' ) ) {
97 add_action( 'bp_group_header_actions', 'bp_group_join_button' );
98 add_action( 'bp_group_header_actions', 'bp_group_new_topic_button' );
99 add_action( 'bp_directory_groups_actions', 'bp_group_join_button' );
100 }
101
102 // Blog button
103 if ( bp_is_active( 'blogs' ) )
104 add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' );
105 }
106 }
107 add_action( 'after_setup_theme', 'bp_dtheme_setup' );
108
109 // Batten down the hatches, we're going full-width... there's got to be a better way to make the theme full-width, but this will work in the meantime. Everything below is just inserting divs to help style a full-width background.
110 function div_bp_before_header() {
111 ?>
112 <div id="bp_before_header" class="fullwidth">
113 <?php
114 }
115 add_action ( 'bp_before_header', 'div_bp_before_header' );
116
117 // close the bp_before_header div
118 function div_bp_after_header() {
119 ?>
120 </div>
121 <?php
122 }
123 add_action ( 'bp_after_header', 'div_bp_after_header' );
124
125 // This could have gone in div_bp_after_header, but we might want to add something later.
126 function div_bp_before_container() {
127 ?>
128 <div id="bp_before_container" class="fullwidth">
129 <?php
130 }
131 add_action ( 'bp_before_container', 'div_bp_before_container' );
132
133 // close the bp_before_container div
134 function div_bp_after_container() {
135 ?>
136 </div>
137 <?php
138 }
139 add_action ( 'bp_after_container', 'div_bp_after_container' );
140
141 // Batten down the hatches, we're going full-width
142 function div_bp_before_footer() {
143 ?>
144 <div id="bp_before_footer" class="fullwidth">
145 <?php
146 }
147 add_action ( 'bp_before_footer', 'div_bp_before_footer' );
148
149 // close the bp_before_footer div
150 function div_bp_after_footer() {
151 ?>
152 </div>
153 <?php
154 }
155 add_action ( 'bp_after_footer', 'div_bp_after_footer' );
156
157
158 // Batten down the hatches, we're going full-width
159 function div_bp_before_activity_post_form() {
160 ?>
161 <div id="bp_before_activity_post_form">
162 <?php
163 }
164 add_action ( 'bp_before_activity_post_form', 'div_bp_before_activity_post_form' );
165
166 // close the bp_before_activity_post_form div
167 function div_bp_after_activity_post_form() {
168 ?>
169 </div>
170 <?php
171 }
172 add_action ( 'bp_after_activity_post_form', 'div_bp_after_activity_post_form' );
173
174 // Batten down the hatches, we're going full-width
175 function div_bp_before_member_header() {
176 ?>
177 <div id="bp_before_member_header">
178 <?php
179 }
180 add_action ( 'bp_before_member_header', 'div_bp_before_member_header' );
181
182 // close the bp_before_member_header div
183 function div_bp_after_member_header() {
184 ?>
185 </div>
186 <?php
187 }
188 add_action ( 'bp_after_member_header', 'div_bp_after_member_header' );
189
190
191 // Batten down the hatches, we're going full-width
192 function div_bp_before_group_header() {
193 ?>
194 <div id="bp_before_group_header">
195 <?php
196 }
197 add_action ( 'bp_before_group_header', 'div_bp_before_group_header' );
198
199 // close the bp_before_group_header div
200 function div_bp_after_group_header() {
201 ?>
202 </div>
203 <?php
204 }
205 add_action ( 'bp_after_group_header', 'div_bp_after_group_header' );
206
207 //site credits
208 add_filter('gettext', 'sitecredits', 20, 3);
209 /**
210 * Edit the default credits to add Frisco link. Remove if you'd like.
211 *
212 * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
213 */
214 function sitecredits( $translated_text, $untranslated_text, $domain ) {
215
216 $custom_field_text = 'Proudly powered by <a href="%1$s">WordPress</a> and <a href="%2$s">BuddyPress</a>.';
217
218 if ( $untranslated_text === $custom_field_text ) {
219 return 'Proudly powered by <a href="http://wordpress.org">WordPress</a>, <a href="http://buddypress.org">BuddyPress</a> and the <a href="http://friscotheme.com/">Frisco Theme</a>.';
220 }
221
222 return $translated_text;
223 }
224
225 ?>
Something went wrong with that request. Please try again.