checking for search page to eliminate events header from the search
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 13 Feb 2018 22:02:48 +0000 (17:02 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 13 Feb 2018 22:02:48 +0000 (17:02 -0500)
removing events header from search results page

functions.php
glm-member-db-events/views/front/events/agenda.html

index 148b9dd..32a0a99 100644 (file)
@@ -373,4 +373,13 @@ function my_limit_archives( $args ) {
     $args['limit'] = 12;
     return $args;
 }
-add_filter( 'widget_archives_args', 'my_limit_archives' );
\ No newline at end of file
+add_filter( 'widget_archives_args', 'my_limit_archives' );
+add_filter('is_page', function($page){
+       $page_function = "is_".$page;
+
+       if(function_exists($page_function)){
+               return $page_function();
+       }else {
+               return false;
+       }
+});
\ No newline at end of file
index 6f695ef..6b27033 100644 (file)
@@ -1,9 +1,10 @@
 <div id="glm-event-wrapper">
         <div class="row">
-        {if $smarty.request.s }
+        {if $smarty.request.s || apply_filters("is_page", 'search')}
             {if $eventsByDate}
                 <hr>
                 <h1>Related Events for: {$smarty.request.s}</h1>
+                {apply_filters("is_page", "search")}
             {/if}
         {else}
             {include file='front/events/searchForm.html'}