-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
109 lines (94 loc) · 3.06 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
<?php
add_action( 'after_setup_theme', 'theme_setup' );
function theme_setup() {
// This theme uses wp_nav_menu() in three locations.
register_nav_menu( 'standard','Hauptmenü' );
register_nav_menu( 'siteservice','Siteservice' );
register_nav_menu( 'footer-menu','Footer Links');
if ( ! isset( $content_width ) )
$content_width = 500;
// Setup for dynamic header image
define('NO_HEADER_TEXT', true );
define('HEADER_TEXTCOLOR', '');
define('HEADER_IMAGE', '%s/images/hintergrundoben.png'); // %s is the template dir uri
define('HEADER_IMAGE_WIDTH', 964); // use width and height appropriate for your theme
define('HEADER_IMAGE_HEIGHT', 130);
add_custom_image_header('header_style', 'admin_header_style');
}
// called in wp_head, needed for custom image header
function header_style() {
?><style type="text/css">
#oben {
background: url(<?php header_image(); ?>);
}
</style><?php
}
// called in admin menu, needed for custom image header
function admin_header_style() {
?><style type="text/css">
#headimg {
width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
background: no-repeat;
}
</style><?php
}
add_action( 'widgets_init', 'theme_widgets_setup' );
function theme_widgets_setup() {
register_sidebar( array(
'name' => 'Linke Sidebar',
'id' => 'sidebar_full_left'
) );
register_sidebar( array(
'name' => 'Rechte Sidebar',
'id' => 'sidebar_full_right'
) );
register_sidebar( array(
'name' => 'Footer Widget Area 01',
'id' => 'footer-widget-area-01',
'description' => 'Erste von 4 Footer-Spalten',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<strong>',
'after_title' => '</strong>',
) );
register_sidebar( array(
'name' => 'Footer Widget Area 02',
'id' => 'footer-widget-area-02',
'description' => 'Zweite von 4 Footer-Spalten',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<strong>',
'after_title' => '</strong>',
) );
register_sidebar( array(
'name' => 'Footer Widget Area 03',
'id' => 'footer-widget-area-03',
'description' => 'Dritte von 4 Footer-Spalten',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<strong>',
'after_title' => '</strong>',
) );
register_sidebar( array(
'name' => 'Footer Widget Area 04',
'id' => 'footer-widget-area-04',
'description' => 'Vierte von 4 Footer-Spalten',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<strong>',
'after_title' => '</strong>',
) );
};
// remove footer, if unused
add_action( 'wp_head', 'remove_footer' );
function remove_footer() {
if( !is_active_sidebar( 'footer-widget-area-01' ) && !is_active_sidebar( 'footer-widget-area-02' ) && !is_active_sidebar( 'footer-widget-area-03' ) && !is_active_sidebar( 'footer-widget-area-04' ) ) : ?>
<style type="text/css">
#fussoben, #fussmitte, #fussunten {
display:none;
}
</style>
<?php endif;
}
?>