This repository was archived by the owner on Nov 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
230 lines (199 loc) · 6.5 KB
/
Copy pathfunctions.php
File metadata and controls
230 lines (199 loc) · 6.5 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?php
// Start the engine
require_once( TEMPLATEPATH . '/lib/init.php' );
// Child theme (do not remove)
define( 'CHILD_THEME_NAME', 'Arconix Computers' );
define( 'CHILD_THEME_URL', 'http://arconixpc.com' );
define( 'CHILD_THEME_VERSION', '3.0.2' );
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'init', 'arconix_post_type_supports' );
add_action( 'wp_enqueue_scripts', 'arconix_load_scripts' );
add_action( 'genesis_meta', 'arconix_add_viewport_meta_tag' );
add_action( 'genesis_footer', 'arconix_do_footer' );
add_action( 'genesis_after_post_content', 'arconix_fix_comments_links' );
add_filter( 'pre_get_posts', 'arconix_pre_get_posts' );
add_filter( 'arconix_do_footer_output', 'do_shortcode', 20 );
add_filter( 'genesis_post_info', 'arconix_post_info' );
add_filter( 'genesis_post_meta', 'arconix_post_meta' );
add_filter( 'genesis_comment_form_args', 'arconix_comment_form_args' );
add_filter( 'arconix_button_shortcode_args', 'arconix_child_button_args' );
add_filter( 'arconix_portfolio_defaults', 'arconix_child_portfolio_args' );
add_filter( 'widget_tag_cloud_args', 'arconix_tag_cloud_widget' );
add_filter( 'pre_register_arconix_plugins_css', '__return_false' );
add_filter( 'pre_register_arconix_portfolio_css', '__return_false' );
add_filter( 'pre_register_arconix_shortcodes_css', '__return_false' );
add_filter( 'pre_register_arconix_testimonials_css', '__return_false' );
// Add Structural Wraps
add_theme_support( 'genesis-structural-wraps', array( 'header', 'inner', 'footer' ) );
// Unregister primary/secondary navigation menus
remove_theme_support( 'genesis-menus' );
// Add our own Image size for the portfolio
add_image_size( 'arconix-thumb', 320, 200 );
// Sets Content Width
$content_width = apply_filters( 'content_width', 740, 740, 1140 );
// Configure layout settings
genesis_set_default_layout( 'content-sidebar' );
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content' );
unregister_sidebar( 'sidebar-alt' );
// Add additional sidebar areas
genesis_register_sidebar( array(
'id' => 'home-top',
'name' => __( 'Home Top', 'arconix' ),
'description' => __( 'This single area is the top widget area on the homepage.', 'arconix' )
) );
genesis_register_sidebar( array(
'id' => 'feature-block',
'name' => __( 'Feature Block', 'arconix' ),
'description' => __( 'This single area is below home top.', 'arconix' )
) );
/**
* Add post type support for genesis-specific options
*
* @since 3.0
*/
function arconix_post_type_supports() {
$post_types = array( 'plugins', 'portfolio', 'testimonials' );
$supports = array( 'genesis-simple-sidebars', 'genesis-layouts' );
foreach( $post_types as $post_type ) {
if( ! post_type_exists( $post_type ) ) continue;
foreach ( $supports as $support ) {
add_post_type_support( $post_type, $support ) ;
}
}
}
/**
* Load Google fonts
*
* @since 3.0
*/
function arconix_load_scripts() {
wp_enqueue_style( 'google-fonts', 'http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Serif', false, $CHILD_THEME_VERSION );
}
/**
* Add Viewport meta tag for mobile browsers
*
* @since 3.0
*/
function arconix_add_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}
/**
* Hook in before the main query is run and modify some values
*
* @version 3.1
* @since 3.0
* @param array $query
* @return void
*/
function arconix_pre_get_posts( $query ) {
if ( is_admin() || ! $query->is_main_query() )
return;
if ( is_post_type_archive( 'portfolio' ) ) {
$query->set( 'posts_per_page', 9 );
return;
}
if ( is_post_type_archive( 'plugin' ) ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'asc' );
$query->set( 'posts_per_page', -1 );
return;
}
if ( is_post_type_archive( 'docs' ) ) {
$query->set( 'post_parent', 0 );
return;
}
}
/**
* Modify the Post Info text
*
* @since 3.0
* @param string $post_info
* @return string
*/
function arconix_post_info( $post_info ) {
return '[post_date] [post_edit before=" | "]';
}
/**
* Modify the Post Meta text
*
* @since 3.0
* @param string $post_meta
* @return string
*/
function arconix_post_meta( $post_meta ) {
return '[post_categories before="Filed In: "] [post_tags before="Tagged: "]';
}
/**
* Custom Footer
*
* @since 3.0
*/
function arconix_do_footer() {
$backtotop_text = wp_nav_menu( array('menu' => 'Footer Nav' ) );
$creds_text = 'Powered by [footer_wordpress_link] and <a href="http://studiopress.com/themes/genesis">Genesis</a> | Hosted by <a href="http://arcnx.co/ix">IX Webhosting</a> | [footer_loginout]';
$output = $backtotop_text . '<div class="creds">' . $creds_text . '</div>';
echo apply_filters( 'arconix_do_footer_output', $output );
}
/**
* Modify the Comment Header Text
*
* @since 3.0
* @param array $args
* @return array $args
*/
function arconix_comment_form_args( $args ) {
$args['title_reply'] = 'Leave a Comment';
return $args;
}
/**
* Modify Standard Arconix Shortcodes Button Color
*
* @since 3.0
* @param array $defaults
* @return array $defaults
*/
function arconix_child_button_args( $defaults ) {
$defaults['color'] = 'green';
return $defaults;
}
/**
* Modify the post type registration for the portfolio so we can use the CPT archive instead of the shortcode
*
* @since 3.0
* @param array $defaults
* @return array $defaults
*/
function arconix_child_portfolio_args( $defaults ) {
$defaults['post_type']['args']['has_archive'] = true;
return $defaults;
}
/**
* Modify the Tag Cloud parameters
*
* @since 3.0
* @version 3.0.1
* @param array $args
* @return array $args
*/
function arconix_tag_cloud_widget( $args ) {
$args['largest'] = 16; // largest tag
$args['smallest'] = 16; // smallest tag
$args['unit'] = 'px'; // tag font unit
$args['format'] = 'list'; // ul with a class of wp-tag-cloud
$args['orderby'] = 'count'; // sort by count
$args['order'] = 'DESC'; // largest to smallest
$args['number'] = 5; // set the number of tags to display
return $args;
}
/**
* Fix #Comments Div Links for Comments Plugins
*
* @since 3.0.1
*/
function arconix_fix_comments_links() {
echo '<div id="comments"></div>';
}