login-page.php
3.11 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
<?php
/*
* Template Name: Login Page
*/
?>
<?php get_header();?>
<div id="page-content">
<div id="login-wrap">
<div id="container">
<?php if (is_user_logged_in()):
?>
<script>window.location.replace("<?php echo site_url(); ?>");</script>
<?php global $current_user;
get_currentuserinfo();
?>
<div class="siblings mobile-hide">
<?php
if ($post->post_parent) {
$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=" . $post->post_parent . "&echo=0");
$titlenamer = get_the_title($post->post_parent);
} else {
$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=" . $post->ID . "&echo=0");
$titlenamer = get_the_title($post->ID);
}
if ($children) {?>
<ul>
<li class="<?php echo $post->post_parent ? '' : 'current_page_item'; ?>"><a href="<?php echo get_permalink($post->post_parent); ?>"><?php echo $titlenamer; ?></a></li>
<?php echo $children; ?>
</ul>
<?php }?>
</div>
<div class="siblings mobile-show">
<?php
if ($post->post_parent) {
$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=" . $post->post_parent . "&echo=0");
$titlenamer = get_the_title($post->post_parent);
} else {
$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=" . $post->ID . "&echo=0");
$titlenamer = get_the_title($post->ID);
}
if ($children) {?>
<ul>
<li class="<?php echo $post->post_parent ? '' : 'current_page_item'; ?>"><a href="<?php echo get_permalink($post->post_parent); ?>"><?php echo $titlenamer; ?></a></li>
<?php echo $children; ?>
</ul>
<?php }?>
</div>
<h2>Welcome <?php echo is_super_admin() ? 'Administrator' : $current_user->user_firstname . ' ' . $current_user->user_lastname; ?></h2>
<p><a href="<?php echo wp_logout_url(home_url()); ?>" title="Logout">>> Member Logout</a></p>
<?php else: ?>
<h2>Broker Login</h2>
<?php $args = array('redirect' => site_url());
if (isset($_GET['action'])): ?>
<div class="success">
<p>
Your password has been reset. Please check your email for your new password.
</p>
</div>
<?php
endif;
if (isset($_GET['login']) && $_GET['login'] == 'failed_empty') {
?>
<div id="login-error">
<p>Login failed: You have entered an incorrect username or password. Please try again.</p>
</div>
<?php
}
wp_login_form($args);
?>
<br />
<a style="margin-left:18px;" href="https://thecommonwell.ca/lost-password/" title="Password Lost and Found">Lost your password</a>
<?php endif;?>
</div>
</div>
</div>
<?php get_footer();?>