/
functions.php
116 lines (88 loc) · 2.64 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
<?php
// shortcode to retrive feed items
//This file is needed to be able to use the wp_rss() function.
include_once(ABSPATH.WPINC.'/rss.php');
function add_blogfeed($atts) {
extract(shortcode_atts(array(
"feed" => '',
"num" => '',
), $atts));
return wp_rss($feed, $num);
}
add_shortcode('addfeed', 'add_blogfeed');
automatic_feed_links();
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '',
'after_title' => '',
));
// Custom Taxonomies
add_action( 'init', 'build_taxonomies', 0 );
function build_taxonomies() {
register_taxonomy(
'uni', 'post', array(
'hierarchical' => true,
'label' => 'universidad',
'query_var' => true,
'rewrite' => array( 'slug' => 'universidad' ),
)
);
register_taxonomy(
'univ', 'post', array(
'hierarchical' => true,
'label' => 'universidad2',
'query_var' => true,
'rewrite' => array( 'slug' => 'universidad2' ),
)
);
register_taxonomy(
'tipode', 'post', array(
'hierarchical' => true,
'label' => 'tipo de proyecto',
'query_var' => true,
'rewrite' => array( 'slug' => 'universidad2' ),
)
);
register_taxonomy(
'yeardate', 'post', array(
'hierarchical' => true,
'label' => 'yeardate',
'query_var' => true,
'rewrite' => true )
);
register_taxonomy(
'ciudad', 'post', array(
'hierarchical' => true,
'label' => 'ciudad',
'query_var' => true,
'rewrite' => true )
);
}
global $is_apache;
$is_apache = true;
/*
Plugin Name: Remove /blog slug plugin for wpmu
Description:Remove /blog slug from wpmu subdirectory install of wpmu default blog
Version: 1.1
Tested up to: Wordpress 3.0 Multisite,buddypress 1.2.5.2
License: GNU General Public License 2.0 (GPL) http://www.gnu.org/licenses/gpl.html
Author: Brajesh Singh
Author URI: http://www.ThinkingInWordpress.com/
Plugin URI:http://thinkinginwordpress.com
tags:wpmu,wpms,buddypress,remove slug
*/
/* let us add filters for intercepting the permalink update,category base update and tag base update */
add_filter("pre_update_option_category_base","cc_remove_blog_slug");
add_filter("pre_update_option_tag_base","cc_remove_blog_slug");
add_filter("pre_update_option_permalink_structure","cc_remove_blog_slug");
/* just check if the current structure begins with /blog/ remove that and return the stripped structure */
function cc_remove_blog_slug($tag_cat_permalink){
if(!preg_match("/^\/blog\//",$tag_cat_permalink))
return $tag_cat_permalink;
$new_permalink=preg_replace ("/^\/blog\//","/",$tag_cat_permalink );
return $new_permalink;
}
/* fin del plugin Remove /blog slug plugin for wpmu */
?>