-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
executable file
·49 lines (43 loc) · 1.73 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
<?php
function monstringen_enqueue_styles() {
$parent_style = 'parent-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style )
);
}
add_action( 'wp_enqueue_scripts', 'monstringen_enqueue_styles' );
function monstringen_body_class( $classes ) {
if ( is_page_template( 'template-sidebar.php' || is_page_template('template-residents.php' ) ) ) {
if (is_active_sidebar('sidebar-1')){
$classes[] = 'has-sidebar';
foreach($classes as $key => $class) {
if( $class == "page-one-column" || $class == "page-two-column"){
unset($classes[$key]);
}
}
}
}
return $classes;
};
add_filter( 'body_class', 'monstringen_body_class', 20);
function register_page_aside_widget_area() {
register_sidebar(
array(
'name' => __( 'Page Sidebar', 'monstringen' ),
'id' => 'sidebar-for-page',
'description' => __( 'Add widgets here to appear on pages.', 'monstringen' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'register_page_aside_widget_area' );
function monstringen_tab_title($title = null, $sep = null, $seplocation = null){
return "BRF Mönstringen | " . get_the_title();
}
add_filter( 'pre_get_document_title', 'monstringen_tab_title', 10, 1);
// add_filter( 'wp_title', 'monstringen_tab_title', 10, 3);