-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfunctions.php
More file actions
executable file
·136 lines (118 loc) · 5.49 KB
/
functions.php
File metadata and controls
executable file
·136 lines (118 loc) · 5.49 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
<?php
/* Woggle 4 Wordpress Remix
*
* Woggle 4 Wordpress Remix is a free Wordpress theme derived from Woggle 4 Wordpress
* developed by hawesWeb Productions available at iscout4wordpress.org.uk
*
* Woggle 4 Wordpress Remix is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Woggle 4 Wordpress Remix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Woggle 4 Wordpress Remix. If not, see <http://www.gnu.org/licenses/>.
*
*/
?>
<?php if ( function_exists('register_sidebar') )
{
register_sidebar(array('name' => 'Sidebar Top','before_widget' => '','after_widget' => '','before_title' => '<h3 class="title">','after_title' => '</h3>'));
register_sidebar(array('name' => 'Sidebar Left','before_widget' => '','after_widget' => '','before_title' => '<h3 class="title">','after_title' => '</h3>'));
register_sidebar(array('name' => 'Sidebar Right','before_widget' => '','after_widget' => '','before_title' => '<h3 class="title">','after_title' => '</h3>'));
/*register_sidebar(array('name' => 'Sidebar Bottom','before_widget' => '','after_widget' => '','before_title' => '<h3 class="title">','after_title' => '</h3>'));
register_sidebar(array('name' => 'Main Left','before_widget' => '','after_widget' => '','before_title' => '<h3 class="title">','after_title' => '</h3>'));
register_sidebar(array('name' => 'Main Center','before_widget' => '','after_widget' => '','before_title' => '<h3 class="title">','after_title' => '</h3>'));
register_sidebar(array('name' => 'Main Right','before_widget' => '','after_widget' => '','before_title' => '<h3 class="title">','after_title' => '</h3>'));
register_sidebar(array('name' => 'Main Right2','before_widget' => '','after_widget' => '','before_title' => '<h3 class="title">','after_title' => '</h3>'));
register_sidebar(array('name' => 'FrontPage Side','before_widget' => '','after_widget' => '','before_title' => '<h3 class="title">','after_title' => '</h3>'));
register_sidebar(array('name' => 'FrontPage Top','before_widget' => '','after_widget' => '','before_title' => '<h3 class="title">','after_title' => '</h3>'));*/
}
remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'custom_trim_excerpt');
remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'custom_trim_excerpt');
add_filter( 'wpcf7_support_html5_fallback', '__return_true' );
add_filter( 'wp_title', 'set_page_title' );
function set_page_title( $orig_title ) {
$title = get_bloginfo( 'name' );
//Here I can echo the result and see that it's actually triggered
// return $title;
echo get_bloginfo('name'); echo " | ", get_bloginfo('description'); echo " » ", get_the_title();
}
function custom_trim_excerpt($text) { // Fakes an excerpt if needed
global $post;
if ( '' == $text ) {
$text = get_the_content('');
$text = strip_shortcodes( $text );
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$text = strip_tags($text);
$excerpt_length = apply_filters('excerpt_length', 90);
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
array_push($words, '...');
$text = implode(' ', $words);
}
}
return $text;
}
if ( ! isset( $content_width ) ) {
$content_width = 1000;
}
?>
<?php
function the_slider_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
$slide = get_the_content($more_link_text, $stripteaser, $more_file);
$slide = apply_filters('the_content', $slide);
$slide = str_replace(']]>', ']]>', $slide);
$slide = strip_tags($slide);
if (strlen($_GET['p']) > 0) {
echo $slide;
}
else if ((strlen($slide)>$max_char) && ($espacio = strpos($slide, " ", $max_char ))) {
$slide = substr($slide, 0, $espacio);
$slide = $slide;
echo $slide;
echo "...";
}
else {
echo $slide;
}
}
function new_excerpt_more($more) {
return '<a href="'. get_permalink($post->ID) . '">' . '<br/> read more..' . '</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
?>
<?php
add_filter('loginout','loginout_text_change');
function loginout_text_change($text) {
$login_text_before = 'Log in';
$login_text_after = 'Member sign-in';
$logout_text_before = 'Log out';
$logout_text_after = 'Member sign-out';
$text = str_replace($login_text_before, $login_text_after ,$text);
$text = str_replace($logout_text_before, $logout_text_after ,$text);
return $text;
}
add_action( 'init', 'register_my_menus' );
function register_my_menus() {
register_nav_menus(
array(
'menu-1' => __( 'Menu' ),
'menu-2' => __( 'Login' )
)
);
}
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
?>
<?php if(function_exists('chi_display_header')) { chi_display_header(); } ?>