-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsidebar.php
executable file
·89 lines (79 loc) · 4.41 KB
/
sidebar.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
<div id="content-sub" class="sub sidebar widgets" role="complementary">
<?php if ( !is_active_sidebar('sidebar') ) : ?>
<?php
/* If we're showing authors, show the bio in the sidebar */
if ( (get_option('onemozilla_hide_authors') != 1) && (is_single() || is_author()) ) : ?>
<aside class="widget vcard author-bio">
<h3 class="widget-title">
<?php if (get_the_author_meta('description')) : ?><?php _e('About','onemozilla'); ?><?php endif; ?>
<?php if (get_the_author_meta('user_url')) : ?>
<a class="url fn author" rel="external me" href="<?php the_author_meta('user_url'); ?>"><?php esc_html(the_author()); ?>
<?php if (function_exists('get_avatar')) : echo ('<span class="photo">'.get_avatar( get_the_author_meta('user_email'), 68 ).'</span>'); endif; ?>
</a>
<?php else : ?>
<a class="url fn author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php esc_html(the_author()); ?>
<?php if (function_exists('get_avatar')) : echo ('<span class="photo">'.get_avatar( get_the_author_meta('user_email'), 68 ).'</span>'); endif; ?>
</a>
<?php endif; ?>
<?php if (get_the_author_meta('twitter_username')) : ?>
<?php echo '<span><a href="http://twitter.com/'.get_the_author_meta('twitter_username').'" class="url" rel="external me">@'.get_the_author_meta('twitter_username').'</a></span>'; ?>
<?php endif; ?>
</h3>
<?php if (get_the_author_meta('description')) : ?>
<p><?php esc_html(the_author_meta('description')); ?></p>
<?php endif; ?>
<?php if (!is_author()) :
if (get_the_author_meta('first_name')) :
$name = esc_html(get_the_author_meta('first_name')); // Use the first name if there is one
else :
$name = esc_html(the_author()); // Fall back to the display name
endif;
?>
<p><a class="url go" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php printf(__('More from %s', 'onemozilla'), $name); ?></a></p>
<?php endif; ?>
</aside>
<?php endif; ?>
<aside id="categories" class="widget widget_categories">
<h3 class="widget-title"><?php _e('Categories', 'onemozilla'); ?></h3>
<ul>
<?php wp_list_categories('show_count=0&title_li='); ?>
</ul>
</aside>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
<?php else : ?>
<?php $options = onemozilla_get_theme_options();
/* If we're showing authors, show the bio in the sidebar */
if ( (get_option('onemozilla_hide_authors') != 1) && (is_single() || is_author()) ) : ?>
<aside class="widget vcard author-bio">
<h3 class="widget-title">
<?php if (get_the_author_meta('description')) : ?><?php _e('About','onemozilla'); ?><?php endif; ?>
<?php if (get_the_author_meta('user_url')) : ?>
<a class="url fn author" rel="external me" href="<?php the_author_meta('user_url'); ?>"><?php esc_html(the_author()); ?>
<?php if (function_exists('get_avatar')) : echo ('<span class="photo">'.get_avatar( get_the_author_meta('user_email'), 68 ).'</span>'); endif; ?>
</a>
<?php else : ?>
<a class="url fn author" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php esc_html(the_author()); ?>
<?php if (function_exists('get_avatar')) : echo ('<span class="photo">'.get_avatar( get_the_author_meta('user_email'), 68 ).'</span>'); endif; ?>
</a>
<?php endif; ?>
<?php if (get_the_author_meta('twitter_username')) : ?>
<?php echo '<span><a href="http://twitter.com/'.get_the_author_meta('twitter_username').'" class="url" rel="external me">@'.get_the_author_meta('twitter_username').'</a></span>'; ?>
<?php endif; ?>
</h3>
<?php if (get_the_author_meta('description')) : ?>
<p><?php esc_html(the_author_meta('description')); ?></p>
<?php endif; ?>
<?php if (!is_author()) :
if (get_the_author_meta('first_name')) :
$name = esc_html(get_the_author_meta('first_name')); // Use the first name if there is one
else :
$name = esc_html(the_author()); // Fall back to the display name
endif;
?>
<p><a class="url go" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"><?php printf(__('More from %s', 'onemozilla'), $name); ?></a></p>
<?php endif; ?>
</aside>
<?php endif; ?>
<?php dynamic_sidebar( 'sidebar' ); ?>
<?php endif; ?>
</div><!-- #content-sub -->