forked from chrisblakley/Nebula
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthor.php
More file actions
160 lines (137 loc) · 6.53 KB
/
author.php
File metadata and controls
160 lines (137 loc) · 6.53 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
/**
* The template for displaying Author Archive pages.
*/
if ( !defined('ABSPATH') ){ //Redirect (for logging) if accessed directly
header('Location: http://' . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], "wp-content/")) . '?ndaat=' . basename($_SERVER['PHP_SELF']));
http_response_code(403);
die();
}
//Disable author archives to prevent ?author=1 from showing usernames.
if ( !nebula()->get_option('author_bios') ){
wp_redirect(home_url('/') . '?s=about', 301);
http_response_code(403);
die();
}
do_action('nebula_preheaders');
get_header(); ?>
<section id="bigheadingcon">
<div class="custom-color-overlay"></div>
<?php if ( get_theme_mod('menu_position', 'over') === 'over' ): ?>
<?php get_template_part('inc/navigation'); ?>
<?php endif; ?>
<div class="container title-desc-con">
<div class="row">
<div class="col">
<h1 class="page-title articles-by">Articles by <strong><?php echo ( get_the_author_meta('first_name') !== '' )? get_the_author_meta('first_name') : get_the_author_meta('display_name'); ?></strong></h1>
</div><!--/cols-->
</div><!--/row-->
</div><!--/container-->
<div id="breadcrumb-section" class="full inner dark">
<div class="container">
<div class="row">
<div class="col">
<?php nebula()->breadcrumbs(); ?>
</div><!--/col-->
</div><!--/row-->
</div><!--/container-->
</div><!--/breadcrumb-section-->
</section>
<?php get_template_part('inc/nebula_drawer'); ?>
<?php if ( have_posts() ){ the_post(); } //Queue the first post then reset it before the loop. ?>
<div id="about-the-author" class="container">
<div class="row">
<?php if ( get_the_author_meta('headshot_url') ): ?>
<div class="col-md-2">
<div class="author-headshot">
<img src="<?php echo esc_attr(get_the_author_meta('headshot_url')); ?>" />
</div>
</div><!--/col-->
<div class="col-md-10">
<?php else : ?>
<div class="col">
<?php endif; ?>
<h2 class="author-name">
<?php if ( get_the_author_meta('user_url') ): ?>
<a href="<?php echo esc_url(get_the_author_meta('user_url')); ?>" target="_blank" rel="noopener">
<?php endif; ?>
<?php echo get_the_author(); ?>
<?php if ( get_the_author_meta('user_url') ): ?>
</a>
<?php endif; ?>
</h2>
<?php if ( get_the_author_meta('usercity') && get_the_author_meta('userstate') ): ?>
<span class="author-location"><i class="fa fa-map-marker"></i> <a href="https://www.google.com/maps?q=<?php echo urlencode(get_the_author_meta('usercity') . '+' . get_the_author_meta('userstate')); ?>" target="_blank" rel="noopener"><?php echo get_the_author_meta('usercity') . ', ' . get_the_author_meta('userstate'); ?></a></span>
<?php endif; ?>
<span class="author-social">
<?php if ( get_the_author_meta('facebook') ): ?>
<a class="facebook" href="http://www.facebook.com/<?php echo get_the_author_meta('facebook'); ?>" target="_blank" rel="noopener" title="<?php echo get_the_author_meta('facebook'); ?>"><i class="fa fa-facebook-square"></i></a> <!-- add tooltips or titles -->
<?php endif; ?>
<?php if ( get_the_author_meta('twitter') ): ?>
<a class="twitter" href="<?php echo nebula()->twitter_url(get_the_author_meta('twitter')); ?>" target="_blank" rel="noopener" title="@<?php echo get_the_author_meta('twitter'); ?>"><i class="fa fa-twitter-square"></i></a>
<?php endif; ?>
<?php if ( get_the_author_meta('googleplus') ): ?>
<a class="googleplus" href="https://plus.google.com/+<?php echo get_the_author_meta('googleplus'); ?>" target="_blank" rel="noopener" title="<?php echo get_the_author_meta('googleplus'); ?>"><i class="fa fa-google-plus-square"></i></a>
<?php endif; ?>
<?php if ( get_the_author_meta('linkedin') ): ?>
<a class="linkedin" href="https://www.linkedin.com/profile/view?id=<?php echo get_the_author_meta('linkedin'); ?>" target="_blank" rel="noopener" title="<?php echo get_the_author_meta('linkedin'); ?>"><i class="fa fa-linkedin-square"></i></a>
<?php endif; ?>
<?php if ( get_the_author_meta('youtube') ): ?>
<a class="youtube" href="https://www.youtube.com/channel/<?php echo get_the_author_meta('youtube'); ?>" target="_blank" rel="noopener" title="<?php echo get_the_author_meta('youtube'); ?>"><i class="fa fa-youtube"></i></a>
<?php endif; ?>
<?php if ( get_the_author_meta('instagram') ): ?>
<a class="instagram" href="http://instagram.com/<?php echo get_the_author_meta('instagram'); ?>" target="_blank" rel="noopener" title="<?php echo get_the_author_meta('instagram'); ?>"><i class="fa fa-instagram"></i></a>
<?php endif; ?>
</span>
<div class="author-meta">
<hr />
<span class="author-jobtitle">
<?php if ( get_the_author_meta('jobtitle') || get_the_author_meta('jobcompany') ): ?>
<i class="fa fa-building"></i>
<?php endif; ?>
<?php if ( get_the_author_meta('jobtitle') ): ?>
<?php echo esc_html(get_the_author_meta('jobtitle')); ?>
<?php if ( get_the_author_meta('jobcompany') ): ?>
at
<?php endif; ?>
<?php endif; ?>
<?php if ( get_the_author_meta('jobcompany') ): ?>
<span style="white-space: nowrap;">
<?php if ( get_the_author_meta('jobcompanywebsite') ): ?>
<a href="<?php echo esc_url(get_the_author_meta('jobcompanywebsite')); ?>" target="_blank" rel="noopener">
<?php endif; ?>
<?php echo get_the_author_meta('jobcompany'); ?>
<?php if ( get_the_author_meta('jobcompanywebsite') ): ?>
</a>
<?php endif; ?>
</span>
<?php endif; ?>
</span>
<span class="author-contact">
<?php if ( get_the_author_meta('user_email') ): ?>
<span class="author-email"><i class="fa fa-envelope"></i> <a href="mailto:<?php echo get_the_author_meta('user_email'); ?>" target="_blank" rel="noopener"><?php echo get_the_author_meta('user_email'); ?></a></span>
<?php endif; ?>
<?php if ( get_the_author_meta('phonenumber') ): ?>
<span class="author-phonenumber"><i class="fa fa-phone"></i> <?php echo get_the_author_meta('phonenumber'); ?></span>
<?php endif; ?>
</span>
<hr />
</div>
<p class="authorbio"><?php echo esc_html(the_author_meta('description')); ?></p>
</div><!--/col-->
</div><!--/row-->
</div><!--/container-->
<div id="content-section">
<div class="container">
<div class="row">
<div class="col-md" role="main">
<?php
rewind_posts();
get_template_part('loop', 'author');
?>
</div><!--/col-->
<?php get_sidebar(); ?>
</div><!--/row-->
</div><!--/container-->
</div><!--/content-section-->
<?php get_footer(); ?>