I am making slow progress
authorIan Weller <ian@gaslightmedia.com>
Wed, 22 Feb 2017 15:39:04 +0000 (10:39 -0500)
committerIan Weller <ian@gaslightmedia.com>
Wed, 22 Feb 2017 15:39:04 +0000 (10:39 -0500)
I am making the theme more generic by making some links dead ends and
removing some codes.

functions.php
sidebar.php

index 4a51681..509f99e 100644 (file)
@@ -29,68 +29,6 @@ if (!function_exists('glm_quicksite_widget_init')) {
     }
 
 }
-/**
- * glm_page_menu
- *
- * Grab the top level pages and their sub pages as the main navigation
- */
-function glm_page_menu($parent = 0, $class = '', $subnav = false, $navImg = null)
-{
-    $frontPageId  = get_option('page_on_front');
-    $parents = array();
-    $pages = get_pages(array(
-        'post_type'   => 'page',
-        'parent'      => $parent,
-        'number'      => '',
-        'exclude'     => $frontPageId,
-        'post_status' => 'publish',
-        'sort_order'  => 'asc',
-        'sort_column' => 'menu_order'
-    ));
-    echo '<ul'.(($class)?' class="'.$class.'"':'').'><!-- begin -->'."\n";
-    if ($navImg) {
-        echo '<li class="nav-img">' . $navImg . '</li>';
-    }
-    foreach ($pages as $page) {
-        if ($parent == 0) {
-            $navImg = get_the_post_thumbnail($page->ID);
-        } else {
-            $navImg = null;
-        }
-        
-        $childs = get_pages('child_of=' . $page->ID);
-        if (count($childs) > 0) {   
-            echo '<li class="has-dropdown nav-item drop">'."\n";
-            echo '<a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a>'."\n";
-            echo glm_page_menu($page->ID, 'sub-menu dropdown', true, $navImg);
-            echo '</li>'."\n";
-        } else if ($page == get_post('1592')) {
-            echo '<li class="no-dropdown nav-item"><a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a></li>'."\n";
-            echo do_shortcode('[product_categories number="" orderby="name" order="asc" columns="1" hide_empty="0" parent="0" ids=""]');
-        } else {
-            echo '<li class="no-dropdown nav-item"><a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a></li>'."\n";
-        }
-        
-    }
-    echo '</ul><!-- end -->'."\n";
-}
-
-function glm_side_menu() {
-    global $post;
-    
-    $parents = get_post_ancestors($post->ID);
-    $id = ($parents) ? $parents[count($parents)-1]: $post->ID;
-    $parent = get_post( $id );
-    if ($id == 0) {
-        $ID = $post->ID;
-    } else {
-        $ID = $parent->ID;
-    }
-    echo '<h3>'.get_the_title($ID).'</h3>';    
-    echo '<ul class="sidebar"><!-- begin -->'."\n";
-    echo wp_list_pages( 'child_of='.$ID.'&title_li=&depth=1&echo=0');
-    echo '</ul><!-- end -->'."\n";
-}
 
 //[children]
 //function show_page_children_list( $atts ){
@@ -127,53 +65,6 @@ add_filter('pre_get_posts','SearchFilter');
 //    ));
 //}
 
-/**
- * glm_page_menu
- *
- * Grab the top level pages and their sub pages as the main navigation
- */
-function glm_offcanvas_menu($parent = 0, $class = '')
-{
-    $frontPageId  = get_option('page_on_front');
-    $parents      = array();
-//    $args         = array(
-//        'post_type'   => 'page',
-//        'parent'      => $parent,
-//        'number'      => '',
-//        'exclude'     => $frontPageId,
-//        'post_status' => 'publish',
-//        'sort_order'  => 'asc',
-//        'sort_column' => 'menu_order'
-//    );
-//    $pages = get_pages($args);
-    $pages = get_pages(array(
-        'post_type'   => 'page',
-        'parent'      => $parent,
-        'number'      => '', 
-        'exclude'     => $frontPageId,
-        'post_status' => 'publish',
-        'sort_order'  => 'asc',
-        'sort_column' => 'menu_order'
-    ));
-    echo '<ul'.(($class)?' class="'.$class.'"':'').'><!-- begin -->'."\n";
-    foreach ($pages as $page) {
-        $childs = get_pages('child_of=' . $page->ID);
-        if (count($childs) > 0) {
-            echo '<li class="has-dropdown">'."\n";
-            echo '<a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a>'."\n";
-            echo '<a class="toggle" href="#"></a>';
-            echo glm_offcanvas_menu($page->ID, 'sub-menu dropdown');
-            echo '</li>'."\n";
-        } else if ($page == get_post('1592')) {
-            echo '<li><a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a></li>'."\n";
-            echo do_shortcode('[product_categories number="" orderby="name" order="asc" columns="1" hide_empty="0" parent="0" ids=""]');
-        } else {
-            echo '<li><a href="'.get_permalink($page->ID).'">'.$page->post_title.'</a></li>'."\n";
-        }
-    }
-    echo '</ul><!-- end -->'."\n";
-}
-
 add_theme_support('post-thumbnails');
 set_post_thumbnail_size(190, 130, true);
 
index 3581d77..97d86b9 100644 (file)
@@ -9,45 +9,32 @@
             <?php } else { ?>
                 
                 <ul class="sidebar shop-sidebar">
-                    <a href="<?php echo esc_url(get_permalink(759)); ?>">
-                        <h3>MUSEUM STORE</h3>
+                    <a href="#">
+                        <h3>STORE</h3>
                     </a>
                     
                     <li class="page_item page_item_has_children">
-                        <a href="<?php echo esc_url(get_permalink(1592)); ?>">
+                        <a href="#">
                             Categories
                         </a>
                     </li>
 
-                 <?php echo do_shortcode('[product_categories number="" orderby="name" order="asc" columns="2" hide_empty="0" parent="0" ids=""]'); ?>   
+                 <?php //echo do_shortcode('[product_categories number="" orderby="name" order="asc" columns="2" hide_empty="0" parent="0" ids=""]'); ?>   
                     <li class="page_item ">
-                        <a href="<?php echo esc_url(get_permalink(760)); ?>">
+                        <a href="#">
                             Cart
                         </a>
                     </li>
                     <li class="page_item">
-                        <a href="<?php echo esc_url(get_permalink(761)); ?>">
+                        <a href="#">
                             Checkout
                         </a>
                     </li>
                     <li class="page_item">
-                        <a href="<?php echo esc_url(get_permalink(762)); ?>">
+                        <a href="#">
                             My Account
                         </a>
                     </li>
                 </ul>
             <?php } ?>
-            
-            <?php if (!is_page('upcoming-events')) {
-                    echo '<a class="tab" href="' . esc_url(get_permalink(1034)).'"><h3>Upcoming Events</h3></a>';
-                }
-                if (!is_page('news')) {
-                    echo '<a class="tab" href="' . esc_url(get_permalink(500)).'"><h3>News</h3></a>';
-                }
-                if (!is_page('must-sees')) {
-                    echo '<a class="tab" href="' . esc_url(get_permalink(581)).'"><h3>The Collections</h3></a>';
-                }
-                if (!is_page('sponsors')) {
-                    echo '<a class="tab" href="' . esc_url(get_permalink(49)).'"><h3>Sponsors</h3></a>';
-                }?>
             </div>
\ No newline at end of file