-
Notifications
You must be signed in to change notification settings - Fork 1
/
nav.php
100 lines (87 loc) · 2.09 KB
/
nav.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
<?php
global $options;
global $image_categories;
global $text_categories;
?>
<div id="dim"></div>
<?php
function do_nav_default() {
global $image_categories;
global $text_categories;
/* list out image categories in descending order of post count */
if( !empty( $image_categories )) {
$categories = wp_list_categories( array(
'title_li' => '',
'orderby' => 'count',
'order' => 'DESC',
'hide_empty' => 0,
'include' => implode( ',', $image_categories ),
'echo' => 0
));
echo str_replace( array( "\n", "\r" ), '', $categories );
}
/* list out text categories in descending order of post count */
if( !empty( $text_categories )) {
$categories = wp_list_categories( array(
'title_li' => '',
'orderby' => 'count',
'order' => 'DESC',
'hide_empty' => 0,
'include' => implode( ',', $text_categories ),
'echo' => 0
));
echo str_replace( array( "\n", "\r" ), '', $categories );
}
}
?>
<?php if( is_front_page() ) { ?>
<?php if( has_nav_menu( 'main') ) { ?>
<?php
wp_nav_menu(array(
'theme_location' => 'main',
'container' => ''
));
?>
<?php } else { ?>
<ul class="menu">
<?php do_nav_default(); ?>
</ul>
<?php } ?>
<?php } ?>
<?php if( has_nav_menu( 'main' ) ) { ?>
<div id="rollover-nav">
<div id="underlay">
<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
<?php
wp_nav_menu(array(
'theme_location' => 'main',
'container' => ''
));
?>
</div>
<div>
<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
<?php
wp_nav_menu(array(
'theme_location' => 'main',
'container' => ''
));
?>
</div>
</div>
<? } else { ?>
<div id="rollover-nav">
<div id="underlay">
<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
<ul>
<?php do_nav_default(); ?>
</ul>
</div>
<div>
<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
<ul>
<?php do_nav_default(); ?>
</ul>
</div>
</div>
<?php } ?>