testing login restriction on blog single page to secure the topics from being
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 20 Jan 2017 20:28:10 +0000 (15:28 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 20 Jan 2017 20:28:10 +0000 (15:28 -0500)
viewed by anyone

sections/blog-single.php

index beeb9cf..a5209d3 100644 (file)
@@ -1,4 +1,10 @@
-                    <main class="blog-single">
+                <?php if (get_post_type( $post ) === "topic" && !current_user_can("glm_members_member") ){ ?>
+                    <div class="forum-login">
+                        <?php get_template_part('parts/glm-members-only-login-form'); ?>
+                    </div>
+                <?php } else { ?>
+                       
+                       <main class="blog-single">
                         <div class="row">
                            <?php if (get_post_type( $post ) === "topic"){ ?>
                                 <a class="topic-breadcrumb" href="<?php echo get_permalink(385); ?>">Back to Forum </a> 
@@ -30,4 +36,5 @@
                                 <?php get_template_part('parts/blog-sidebar-r'); ?>
                           <?php } ?>
                         </div>
-                    </main>
\ No newline at end of file
+                    </main>
+                    <?php } ?>
\ No newline at end of file