Using MEMBERS_ONLY_ID constant for convenience
authorLaury GvR <laury@gaslightmedia.com>
Tue, 27 Sep 2016 19:31:19 +0000 (15:31 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 27 Sep 2016 19:32:37 +0000 (15:32 -0400)
Throughout the theme we use the a very verbose way to get the
members only id: get_option(GLM_MEMBERS_PLUGIN_OPTION_MEMBERS_
ONLY_ID) -- this is meant to simplify that.

functions.php
sections/header.php
sections/interior-page.php

index d50bb3c..f88f75d 100644 (file)
@@ -2,6 +2,8 @@
 require_once 'lib/menu-walker.php';
 require_once 'lib/navigation.php';
 
+define( MEMBERS_ONLY_ID, get_option( GLM_MEMBERS_PLUGIN_OPTION_MEMBERS_ONLY_ID ) );
+
 $ancestorId   = null;
 $includePages = array();
 $frontPageId  = get_option('page_on_front');
index b80948c..692a822 100644 (file)
@@ -13,6 +13,7 @@
                     <ul class="menu">
                         <li><a href="<?php bloginfo('url')?>">Home</a></li>
                         <li><a href="<?php echo get_permalink(259);?>">Contact Us</a></li>
+                        <li><a href="<?php echo get_permalink(MEMBERS_ONLY_ID);?>">Members Area</a></li>
                     </ul>
                 </div>
                 <div class="large-3 columns show-for-large">
index 78a680b..d30e5fc 100644 (file)
@@ -32,7 +32,7 @@
                         <?php get_template_part('parts/chamber-sidebar-left'); ?>
                      </div>    
 
-                <?php } else if(is_in_tree(get_option(GLM_MEMBERS_PLUGIN_OPTION_MEMBERS_ONLY_ID))) { ?>
+                <?php } else if(is_in_tree(MEMBERS_ONLY_ID)) { ?>
                     <?php get_template_part('sections/glm-members-only'); ?>
                 <?php } else if (is_member()) { ?>
                     <?php if(!is_front_page()) {