.current_page_item a {
font-weight: bold; }
-.current {
+.sidebar .current {
color: #57b649 !important; }
.search-top #searchform {
return false;
}
}
-?>
+
+/**
+ * Function Name: front_end_login_fail.
+ * Added for: GLM Member DB front-end login failure custom redirection.
+ * Description: This redirects the failed login to the custom login page
+ * instead of default login page with a modified url
+**/
+add_action( 'wp_login_failed', 'front_end_login_fail' );
+function front_end_login_fail( $username ) {
+ // Getting URL of the login page
+ $referrer = $_SERVER['HTTP_REFERER'];
+ // if there's a valid referrer, and it's not the default log-in screen
+ if( !empty( $referrer ) && !strstr( $referrer,'wp-login' ) && !strstr( $referrer,'wp-admin' ) ) {
+ wp_redirect( get_permalink( get_option('glm_members_database_option_members_only_id') ) . "?login=failed" );
+ exit;
+ }
+}
+
+/**
+ * Function Name: front_end_blank_credentials.
+ * Added for: GLM Member DB front-end login failure custom redirection.
+ * Description: This redirects to the custom login page if user name or
+ * password is empty with a modified url
+**/
+add_action( 'authenticate', 'front_end_blank_credentials', 1, 3);
+function front_end_blank_credentials( $login, $username, $password ) {
+
+ // Getting URL of the login page
+ $referrer = $_SERVER['HTTP_REFERER'];
+ // if there's a valid referrer, and it's not the default log-in screen
+ if( !empty( $referrer ) && !strstr( $referrer,'wp-login' ) && !strstr( $referrer,'wp-admin' ) ) {
+ if( $username == "" || $password == "" ){
+ wp_redirect( get_permalink( get_option('glm_members_database_option_members_only_id') ) . "?login=empty" );
+ exit;
+ }
+ }
+}
+
+?>
\ No newline at end of file
<div class="small-12 large-8 columns right">
<?php } ?>
<div class="row">
- <div id="main-content" class="small-12 columns">
+ <div id="main-content" class="small-12 columns">
<?php if (current_user_can("glm_members_login")) { ?>
<div id="glm-member-front-header" class="small-12 columns">
<div class='glm-member-greeting'>Hello, <?php $current_user = wp_get_current_user();echo $current_user->user_login ?>.</div>
<a class='button glm-button' href='<?php echo get_admin_url() ?>admin.php?page=glm-members-admin-menu-members'>Enter Member Admin Area</a>
<?php } ?>
</div>
- <?php get_template_part('parts/bread-crumbs'); ?>
-
+ <?php get_template_part('parts/bread-crumbs'); ?>
<?php if(have_posts()) : while(have_posts()): the_post();?>
- <?php the_content();?>
+ <?php the_content();?>
<?php endwhile; else:?>
- <p><?php _e('Sorry, no results found.');?></p>
+ <p><?php _e('Sorry, no results found.');?></p>
<?php endif;?>
-
<?php } else { ?>
- <p id="glm-member-login-notification">Please log in to gain access to this page</p>
+ <div class="wp_login_error">
+ <p id="glm-member-login-notification">
+ <?php if( isset( $_GET['login'] ) && $_GET['login'] == 'failed' ) { ?>
+ The password you entered is incorrect, Please try again.
+ <?php }
+ else if( isset( $_GET['login'] ) && $_GET['login'] == 'empty' ) { ?>
+ Please enter both username and password.
+ <?php } else { ?>
+ Please log in to gain access to this page
+ <?php } ?>
+ </p>
+ </div>
<div id='glm-member-login-form'>
<?php wp_login_form(1, get_permalink()); ?>
</div>
$sideMenu = $allMenu = $pageMenuId = array();
// do not use appearance menu for the following page ID's or their ancestors
//if( !is_page(array(3200, 3201,3202,3203)) && !is_in_tree(3200) && !is_in_tree(3201) && !is_in_tree(3202) && !is_in_tree(3203)) {
- if (is_in_tree(get_option('glm_members_database_members_only_id'))) {
+ if (is_in_tree(get_option('glm_members_database_option_members_only_id'))) {
if (($locations = get_nav_menu_locations()) && isset($locations['members-only'])) {
$menu = wp_get_nav_menu_object($locations['members-only']);
}
.current_page_item a {
font-weight: bold;
}
-.current{
+.sidebar .current {
color: $green !important;
}
\ No newline at end of file