From afcb1cd8d462815894cae3329739d7e1df0d9c02 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 12 Jan 2016 16:06:19 -0500 Subject: [PATCH] testing dropdown restriction navigation --- index.php | 6 ++++-- views/list_products.php | 30 +++++++++++++++++++----------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/index.php b/index.php index 5e66988..e55a54f 100644 --- a/index.php +++ b/index.php @@ -440,9 +440,10 @@ function michsci_shortcode($atts) if ( isset($atts['cat']) ) { if ($prodCategory = get_term_by( 'slug', $atts['cat'], MICHSCI_CATEGORY_NAME ) ) { + if(!isset($_REQUEST[MICHSCI_CATEGORY_NAME])){ $_REQUEST[MICHSCI_CATEGORY_NAME] = $prodCategory->term_id; - $cat_id = $_REQUEST[MICHSCI_CATEGORY_NAME]; - + } + $cat_id = $prodCategory->term_id; } } echo '
@@ -533,6 +534,7 @@ function michsci_get_terms_dropdown($cat_id) function michsci_list_products() { global $wpdb, $wp; + $cat = get_term($cat_id, MICHSCI_CATEGORY_NAME); $args = array( 'posts_per_page' => -1, 'post_type' => 'miproduct' diff --git a/views/list_products.php b/views/list_products.php index 14e7aa5..6e6c069 100644 --- a/views/list_products.php +++ b/views/list_products.php @@ -1,25 +1,33 @@ - -
- name; - } + $term = get_term($cats, MICHSCI_CATEGORY_NAME); ?> + ID,'michsci_tag'); ?> + + + ID,'michsci_tag'); ?>
product grid small-12 medium-4 columnsend){ echo ' end';}?>"> - -- 2.17.1