This repository was archived by the owner on May 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtemplate-members.php
More file actions
53 lines (42 loc) · 1.37 KB
/
template-members.php
File metadata and controls
53 lines (42 loc) · 1.37 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
<?php
/**
* Template Name: WPCampus: Members
*/
// Is the user logged in?
$is_user_logged_in = is_user_logged_in();
get_header();
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
// Only show content if logged in.
if ( $is_user_logged_in ) :
// Add logout link.
$logout_url = wp_logout_url( get_permalink() );
?><p><a href="<?php echo $logout_url; ?>"><?php _e( 'Logout', 'wpcampus' ); ?></a></p><?php
// Print content.
wpcampus_print_article();
else :
?>
<div class="panel blue center">
<p><?php printf( __( 'Membership into the %1$s community is open to all who wish to be involved.<br />%2$sFill out our user registration%3$s to join the fun.', 'wpcampus' ), 'WPCampus', '<a href="/user-registration/"><strong>', '</strong></a>' ); ?></p>
</div>
<?php
// Force login.
wp_login_form( array(
'remember' => true,
'form_id' => 'login-form',
'id_username' => 'user-login',
'id_password' => 'user-pass',
'id_remember' => 'remember-me',
'id_submit' => 'wp-submit',
'label_username' => __( 'Username', 'wpcampus' ),
'label_password' => __( 'Password', 'wpcampus' ),
'label_remember' => __( 'Remember Me', 'wpcampus' ),
'label_log_in' => __( 'Login', 'wpcampus' ),
'value_username' => '',
'value_remember' => false,
));
endif;
endwhile;
endif;
get_footer();