Add members only sidebar menu functionality
authorLaury GvR <laury@gaslightmedia.com>
Fri, 2 Mar 2018 00:56:51 +0000 (19:56 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Fri, 2 Mar 2018 00:56:51 +0000 (19:56 -0500)
landingpage-template.php [deleted file]
lib/navigation.php
sections/header.php

diff --git a/landingpage-template.php b/landingpage-template.php
deleted file mode 100644 (file)
index bc72fc8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-/** Template Name: Landing Page
- */
-get_template_part('index');
index c417208..b69e414 100644 (file)
@@ -5,17 +5,25 @@ register_nav_menus(array(
     'top-links' => 'Header Links'
 ));
 
+if ( ! function_exists( 'glm_theme_members_only' ) ) {
+    function glm_theme_members_only($location) {
+        echo '<ul class="members-only">';
+        echo glm_theme_top_bar( $location );
+        echo '</ul>';
+    }
+}
+
 /**
  * Top Bar
  */
 if ( ! function_exists( 'glm_theme_top_bar' ) ) {
-  function glm_theme_top_bar() {
+  function glm_theme_top_bar($location) {
       wp_nav_menu(array(
           'container' => false,                           // remove nav container
           'container_class' => '',                        // class of container
           'menu' => '',                                   // menu name
           'menu_class' => '',                             // adding custom nav class
-          'theme_location' => 'top-bar',                  // where it's located in the theme
+          'theme_location' => $location,                  // where it's located in the theme
           'before' => '',                                 // before each link <a>
           'after' => '',                                  // after each link </a>
           'link_before' => '',                            // before each link text
index 38ce457..bf5eb2f 100644 (file)
@@ -13,7 +13,7 @@
     <nav class="top-bar text-center show-for-large-up opensearchserver.ignore" data-topbar role="navigation">
         <a id="top-bar-logo-wrapper" href="<?php bloginfo('url')?>"><img id="top-bar-logo" src="<?php echo get_template_directory_uri();?>/assets/logo.png" class="left"></a>
         <section class="top-bar-section right">
-            <?php glm_theme_top_bar(); ?>
+            <?php glm_theme_top_bar('top-bar'); ?>
         </section>
     </nav>
     <nav class="tab-bar show-for-medium-down">