-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
54 lines (43 loc) · 1.38 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
<?php
if (defined('ICL_LANGUAGE_CODE')) {
define('ICL_DONT_LOAD_NAVIGATION_CSS', true);
define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true);
define('ICL_DONT_LOAD_LANGUAGES_JS', true);
function lang_switch_link() {
$arr = icl_get_languages();
$cur = ICL_LANGUAGE_CODE;
if ($cur == "de" && array_key_exists('en', $arr)) {
$url = $arr["en"]["url"];
} elseif (array_key_exists('de', $arr)) {
$url = $arr["de"]["url"];
} else {
$url = "#";
}
?>
<a class="lang-link" href="<?php echo $url ?>" title="<?php _e('View translated page', 'bonestheme') ?>"></a>
<?php
}
} else {
function lang_switch_link() {}
}
function ieee_login_css() {
wp_dequeue_style( bones_login_css );
wp_enqueue_style( 'ieee_login_css', get_stylesheet_directory_uri() . '/library/css/login.css', false );
}
add_action( 'login_enqueue_scripts', 'ieee_login_css', 15 );
// Show posts of 'post' and 'event' post types on home page
add_action( 'pre_get_posts', 'add_my_post_types_to_query' );
function add_my_post_types_to_query( $query ) {
if ( is_home() && $query->is_main_query() )
$query->set( 'post_type', array( 'event', 'post') );
$query->set('tax_query', array(
array(
'taxonomy' => 'event-categories',
'field' => 'slug',
'terms' => array('termin', 'appointment'),
'operator' => 'NOT IN'
)
));
return $query;
}
?>