DEFINE("BLOCKS_FRONT_TOP_GROUP",69302);
DEFINE("BLOCKS_FOOTER_AREA_GROUP",69304);
+DEFINE("MEMBERS_ONLY_PAGE_ID",get_option("glm_members_database_option_members_only_id"));
+DEFINE("MEMBERS_ONLY_LOGIN_PAGE_ID",69625);
if ( ! function_exists( 'wmta_setup' ) ) :
/**
<p><?php _e('Sorry, no posts yet');?></p>
<?php endif;?>
</div>
- <?php } else if (get_the_ID() == get_option("glm_members_database_option_members_only_id")) {?>
+
+ <?php } else { ?>
<div id="main-content" class="small-12 columns">
- <?php if (is_member()) {
- echo "<div class='member-profile-title'>" . get_member_name() . "</div>";
- } ?>
- <?php if(have_posts()) : while(have_posts()): the_post();?>
- <?php the_content();?>
- <?php endwhile; else:?>
- <p><?php _e('Sorry, no posts yet');?></p>
- <?php endif;?>
+ <?php
+ // Show the content of the Members Only Login page
+ echo get_post_field('post_content', MEMBERS_ONLY_LOGIN_PAGE_ID);
+ ?>
+ <?php get_template_part('template-parts/glm-members-only-login-form');?>
</div>
- <?php get_template_part('template-parts/glm-members-only-login-form'); ?>
- <?php } else { ?>
- <?php get_template_part('template-parts/glm-members-only-login-form');?>
+
+
<?php } ?>
</div>
<?php wmta_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->
- <?php } else { ?>
- <div class="post-page-title"><?php echo '<h1><a href="',get_the_permalink('34'),'">',get_the_title('34'),'</a></h1>'; ?></div>
+ <?php } else { ?>
+ <div class="post-page-title"><?php echo '<h1><a href="',get_the_permalink('34'),'">',get_the_title('34'),'</a></h1>'; ?></div>
<?php if ( is_home() && ! is_front_page() ) : ?>
<header>
<div id='glm-member-login-form'>
<?php
update_option('glm_members_database_frontend_login_request', 'true');
+
+ // This attempt to control redirection gets ignored until we manage to get the Contacts plugin to force redirection to Members Only..
+ if ($post->ID === MEMBERS_ONLY_LOGIN_PAGE_ID) {
+ $redirect_target = MEMBERS_ONLY_PAGE_ID;
+ } else {
+ $redirect_target = "";
+ }
+
$args = array(
'echo' => false,
- 'form_id' => 'glm_login_form'
+ 'form_id' => 'glm_login_form',
+ 'redirect'=> $redirect_target
);
$loginForm = wp_login_form($args);
$captcha = apply_filters('cptch_display', '', 'glm_login_form');