From: Laury GvR Date: Wed, 10 May 2017 19:03:27 +0000 (-0400) Subject: Only show RV blocks when not on Housing page X-Git-Tag: v1.0.7~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=5b63ef544103cf6b8454ef28100dbe436398d6a4;p=WP-Themes%2Fbrewbakers.git Only show RV blocks when not on Housing page --- diff --git a/functions.php b/functions.php index e154811..661d6f8 100644 --- a/functions.php +++ b/functions.php @@ -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 ?> diff --git a/glm-member-db/views/front/members/list.html b/glm-member-db/views/front/members/list.html index 6df7a8a..b00a183 100644 --- a/glm-member-db/views/front/members/list.html +++ b/glm-member-db/views/front/members/list.html @@ -738,11 +738,11 @@ {include file='front/footer.html'} +{if apply_filters('wp-is-current-page', 'manufactured-homes-and-michigan-modular-homes') == false }
{$blocks = apply_filters('glm_blocks', '')} {if $blocks} {foreach $blocks as $block name="glm_block"} - {if $smarty.foreach.glm_block.index % 3 == 0}
{/if} @@ -762,5 +762,5 @@ {/if} {/foreach} {/if} -
+{/if} \ No newline at end of file