-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstaff.php
82 lines (79 loc) · 3.54 KB
/
staff.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
<?php
get_header();
/*
Template Name: スタッフ一覧テンプレート
*/
?>
<div id="content">
<div class="wrap">
<header class="page-header">
<?php breadcrumb(); ?>
<h1 class="page-title"><?php the_title(); ?></h1>
<div class="entry-content">
<?php the_content(); ?>
</div>
</header>
<div class="members-cards">
<?php
define("MEMBER_NUMBER_PER_PAGE", get_option('posts_per_page'));
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$offset = ($paged - 1) * MEMBER_NUMBER_PER_PAGE;
$users = get_users();
$query = get_users('&offset=' . $offset . '&number=' . MEMBER_NUMBER_PER_PAGE);
$total_users = count($users);
$total_query = count($query);
$total_pages = intval($total_users / MEMBER_NUMBER_PER_PAGE) + 1;
foreach ($query as $user) {
$uid = $user->ID ?>
<div class="member-card">
<div class="authorall_img"><?php echo get_avatar($uid, 150); ?></div>
<div class="authortext">
<a href="<?php echo get_author_posts_url($uid); ?>"><?php echo $user->display_name; ?></a>
</div>
<?php if ( $user->user_description ): ?>
<p class="authordescri"><?php echo $user->user_description; ?></p>
<?php endif; ?>
<ul class="profile-sns">
<?php if (get_user_meta($uid, 'twitter', true) != "") : ?>
<li>
<a href="https://twitter.com/<?php echo $user->twitter; ?>" title="twitter" rel="noopener"><i class="fab fa-twitter"></i></a>
</li>
<?php endif; ?>
<?php if (get_user_meta($uid, 'instagram', true) != "") : ?>
<li>
<a href="<?php echo $user->instagram; ?>" title="instagram" rel="noopener"><i class="fab fa-instagram"></i></a>
</li>
<?php endif; ?>
<?php if (get_user_meta($uid, 'youtube', true) != "") : ?>
<li>
<a href="<?php echo $user->youtube; ?>" title="youtube" rel="noopener"><i class="fab fa-youtube"></i></a>
</li>
<?php endif; ?>
<?php if ($user->user_url != "") : ?>
<li>
<a href="<?php echo $user->user_url; ?>" title="<?php echo $user->user_url; ?>" rel="noopener"><i class="fa-solid fa-link"></i></a>
</li>
<?php endif; ?>
</ul>
</div>
<?php }
?>
</div>
<div class="pagination">
<?php
if ($total_users > $total_query) {
$current_page = max(1, get_query_var('paged'));
echo paginate_links(array(
'format' => 'page/%#%/',
'total' => $total_pages,
'current' => $current_page,
"prev_text" => "<i class='fa fa-chevron-left'></i>",
'next_text' => "<i class='fa fa-chevron-right'></i>",
'type' => 'list',
));
}
?>
</div>
</div>
</div>
<?php get_footer();