Only show RV blocks when not on Housing page
authorLaury GvR <laury@gaslightmedia.com>
Wed, 10 May 2017 19:03:27 +0000 (15:03 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 10 May 2017 19:04:12 +0000 (15:04 -0400)
functions.php
glm-member-db/views/front/members/list.html

index e154811..661d6f8 100644 (file)
@@ -232,6 +232,33 @@ function is_post_type($type){
     return false;
 }
 
+add_filter('wp-is-current-page', function( $given_slug ) {
+    global $post;
+    $post_slug=$post->post_name;
+    if ($post_slug == $given_slug ) {
+        return true;
+    } else {
+        return false;
+    }
+
+}, 10, 1);
+
+add_filter('glm-member-db-fields-front-list-query-params', function( $query ){
+    $queryParams = array();
+    // Check for manufactures
+    if ( isset( $_REQUEST['manufacturers'] ) && is_array( $_REQUEST['manufacturers'] ) ) {
+        foreach ( $_REQUEST['manufacturers'] as $man ) {
+            $queryParams[] = "manufacturers[]={$man}";
+        }
+    }
+    // This needs to be done for now until it is in the main plugin.
+    if ( isset( $_REQUEST['categorySearchMultiple'] ) && is_array( $_REQUEST['categorySearchMultiple'] ) ) {
+        foreach ( $_REQUEST['categorySearchMultiple'] as $cat ) {
+            $queryParams[] = "categorySearchMultiple[]={$cat}";
+        }
+    }
+    return ( !empty( $queryParams ) ? $query . '&'.implode( '&', $queryParams): $query);
+},10, 1);
 add_action('thematic_searchloop', 'mytheme_search_loop');
 // End of the Contextual/Highlight Search functions
 ?>
index 6df7a8a..b00a183 100644 (file)
         </div><!-- glm-member-list-inner-wrapper-->
     </div><!-- glm-member-db-list-view -->
 {include file='front/footer.html'}
+{if apply_filters('wp-is-current-page', 'manufactured-homes-and-michigan-modular-homes') == false }
 <div id="manufacturers-brands-container">
     {$blocks = apply_filters('glm_blocks', '')}
     {if $blocks}
         {foreach $blocks as $block name="glm_block"}
-
             {if $smarty.foreach.glm_block.index % 3 == 0}
                 <div class="glm-row">
             {/if}
             {/if}
         {/foreach}
     {/if}
-
 </div>
+{/if}
\ No newline at end of file