From 8ef9b0a3a73fade4163c5cbfdadc23863af0089c Mon Sep 17 00:00:00 2001 From: Ian Weller Date: Wed, 22 Feb 2017 10:39:04 -0500 Subject: [PATCH] I am making slow progress I am making the theme more generic by making some links dead ends and removing some codes. --- functions.php | 109 -------------------------------------------------- sidebar.php | 27 ++++--------- 2 files changed, 7 insertions(+), 129 deletions(-) diff --git a/functions.php b/functions.php index 4a51681..509f99e 100644 --- a/functions.php +++ b/functions.php @@ -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 ''."\n"; - if ($navImg) { - echo ''; - } - 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 ''."\n"; - } else if ($page == get_post('1592')) { - echo ''."\n"; - echo do_shortcode('[product_categories number="" orderby="name" order="asc" columns="1" hide_empty="0" parent="0" ids=""]'); - } else { - echo ''."\n"; - } - - } - echo ''."\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 '

'.get_the_title($ID).'

'; - echo ''."\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 ''."\n"; - foreach ($pages as $page) { - $childs = get_pages('child_of=' . $page->ID); - if (count($childs) > 0) { - echo '
  • '."\n"; - echo ''.$page->post_title.''."\n"; - echo ''; - echo glm_offcanvas_menu($page->ID, 'sub-menu dropdown'); - echo '
  • '."\n"; - } else if ($page == get_post('1592')) { - echo '
  • '.$page->post_title.'
  • '."\n"; - echo do_shortcode('[product_categories number="" orderby="name" order="asc" columns="1" hide_empty="0" parent="0" ids=""]'); - } else { - echo '
  • '.$page->post_title.'
  • '."\n"; - } - } - echo ''."\n"; -} - add_theme_support('post-thumbnails'); set_post_thumbnail_size(190, 130, true); diff --git a/sidebar.php b/sidebar.php index 3581d77..97d86b9 100644 --- a/sidebar.php +++ b/sidebar.php @@ -9,45 +9,32 @@ - -

    Upcoming Events

    '; - } - if (!is_page('news')) { - echo '

    News

    '; - } - if (!is_page('must-sees')) { - echo '

    The Collections

    '; - } - if (!is_page('sponsors')) { - echo '

    Sponsors

    '; - }?> \ No newline at end of file -- 2.17.1