forked from hultsfredskommun/hultsfredskommun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfooter.php
109 lines (98 loc) · 3.83 KB
/
footer.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
/**
* The template for displaying the footer.
*
* Contains the closing of the id=main div and all content after
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
/* get hk_options */
$hk_options = get_option('hk_theme');
global $default_settings;
?>
</div><!-- .main-wrapper -->
</div><!-- #main -->
<?php //hk_contact_tab(); ?>
<?php if ($hk_options["contact_side_link"] != "") : ?>
<div id="contact-side-tab"><a href="<?php echo $hk_options["contact_side_link"]; ?>" title="Lämna din synpunkt eller felanmälan"></a></div>
<?php endif; ?>
<?php if ($hk_options["comment_side_link"] != "") : ?>
<div id="comment-side-tab"><a href="<?php echo $hk_options["comment_side_link"]; ?>" title="Hjälp oss att bli bättre"></a></div>
<?php endif; ?>
<?php if ( $hk_options["logo_footer_image"] ||
is_active_sidebar( 'footer-sidebar' ) || is_active_sidebar( 'footer-sidebar-2' ) || is_active_sidebar( 'footer-sidebar-3' ) || is_active_sidebar( 'footer-sidebar-4' ) ||
is_active_sidebar( 'footer2-sidebar' ) || is_active_sidebar( 'footer2-sidebar-2' ) || is_active_sidebar( 'footer2-sidebar-3' ) || is_active_sidebar( 'footer2-sidebar-4' ) ) : ?>
<footer id="colophon" class="colophon" role="contentinfo">
<a name="footer"></a>
<?php
function create_footer($prefix) {
$footers = 0;
if ( is_active_sidebar( $prefix . '-sidebar' ) ) { $footers++; }
if ( is_active_sidebar( $prefix . '-sidebar-2' ) ) { $footers++; }
if ( is_active_sidebar( $prefix . '-sidebar-3' ) ) { $footers++; }
if ( is_active_sidebar( $prefix . '-sidebar-4' ) ) { $footers++; }
$footerclass = "";
switch($footers) {
case 1:
$footerclass = "one";
break;
case 2:
$footerclass = "two";
break;
case 3:
$footerclass = "three";
break;
case 4:
$footerclass = "four";
break;
}
if ( $footers > 0 ) :
echo "<div class='$prefix-wrapper footer-widget-wrapper'><div class='content--center'><div class='gw $prefix-sidebar footer-widget-sidebar widget-area $footerclass'>";
if ( is_active_sidebar( $prefix . '-sidebar' ) ) {
echo "<div class='g footer-widgets first'>";
dynamic_sidebar( $prefix . '-sidebar' );
echo "</div>";
}
if ( is_active_sidebar( $prefix . '-sidebar-2' ) ) {
echo "<div class='g footer-widgets second'>";
dynamic_sidebar( $prefix . '-sidebar-2' );
echo "</div>";
}
if ( is_active_sidebar( $prefix . '-sidebar-3' ) ) {
echo "<div class='g footer-widgets third'>";
dynamic_sidebar( $prefix . '-sidebar-3' );
echo "</div>";
}
if ( is_active_sidebar( $prefix . '-sidebar-4' ) ) {
echo "<div class='g footer-widgets fourth'>";
dynamic_sidebar( $prefix . '-sidebar-4' );
echo "</div>";
}
echo "</div></div></div>";
endif;
}
/* create the two footers */
create_footer("footer");
create_footer("footer2");
if (($hk_options["footer_image"] != "") || ( $hk_options["logo_footer_image"] != "")) : ?>
<div class="footer-image-wrapper">
<?php /* footer image */
if ($hk_options["footer_image"] != "") : ?>
<div class="footer-image"><div class='content--center'><img src="<?php echo $hk_options["footer_image"]; ?>" alt='Sidfot' title='Sidfot' /></div></div>
<?php endif;
if ( $hk_options["logo_footer_image"] ) :
?>
<div class="logo-footer-image"><div class='content--center'><img src="<?php echo $hk_options["logo_footer_image"]; ?>" alt='Logotyp' title='Logotyp' /></div></div>
<?php endif; ?>
</div><!-- .footer-image-wrapper -->
<?php endif; ?>
</footer><!-- #colophon -->
<?php endif; ?>
</div><!-- #page -->
<?php wp_footer(); ?>
<div id="scrollTo_top" class="scrolltotop"><a href="#"></a></div>
<pre id="log" class="log"></pre>
</body>
</html>