Custom search template problem

Forums › Forums › Search & Filter Pro › Custom search template problem

Tagged: 

Viewing 5 posts – 1 through 5 (of 5 total)
  • Anonymous
    #2441

    Hi, Search Filter plugin is great, but I have a problem.
    To use custom search template, I must create my-search.php in /wp-content/themes/my_theme/.
    But I use Gantry Framework and all page templates located in /wp-content/themes/my_theme/html/
    If I put my-search.php in /wp-content/themes/my_theme/, Gantry doesn’t see it.
    If I put my-search.php in /wp-content/themes/my_theme/html/, Search plugin doesn’t see it.
    How it is possible to resolve this problem?

    Ross Moderator
    #2465

    Hey Maxim, just put it in my_theme – it doesn’t matter if Gantry doesn’t see it, as long as the plugin does 🙂

    Let me know if that works!

    Anonymous
    #2484

    Hi, thanks for answer, but its doesn’t work.
    I put mbsearch.php in /wp-content/themes/rt_acacia_wp/ with code like in original search.php

    <?php
    /**
     * @version   4.1.2 May 18, 2014
     * @author    RocketTheme http://www.rockettheme.com
     * @copyright Copyright (C) 2007 - 2014 RocketTheme, LLC
     * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
     */
    // no direct access
    defined( 'ABSPATH' ) or die( 'Restricted access' );
    ?>
    
    <?php global $post, $posts, $query_string, $wp_query, $s; ?>
    
    	<?php /** Begin Query Setup **/ ?>
    	
    	<?php
    
    	$page_context = $this->getContext();
    
    	$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
    
    	$query = $wp_query->query;
    	if ( !is_array( $query ) ) parse_str( $query, $query ); 
    	
    	$custom_query = new WP_Query( array_merge( $query, array( 'posts_per_page' => $gantry->get( $page_context . '-count', '5' ), 'paged' => $paged ) ) ); ?>
    
    	<?php /** End Query Setup **/ ?>
    
    	<?php if( $custom_query->have_posts() ) : ?>
    	
    		<?php /** Begin Page Heading **/ ?>
    		
    		<?php if( $gantry->get( $page_context . '-page-heading-enabled', '1' ) ) : ?>
    		
    			<?php if( $gantry->get( $page_context . '-page-heading-text' ) != '' ) : ?>
    			
    				<h1>
    					<?php echo $gantry->get( $page_context . '-page-heading-text' ); ?>
    				</h1>
    			
    			<?php else : ?>
    																												
    				<h1>
    					<?php printf( _r( 'Search Results for: %s' ), '<span>' . get_search_query() . '</span>' ); ?>
    				</h1>
    
    			<?php endif; ?>
    
    		<?php endif; ?>
    		
    		<?php /** End Page Heading **/ ?>
    
    		<?php /** Begin Posts **/ ?>
    														
    		<?php while ($custom_query->have_posts()) : $custom_query->the_post(); ?>
    
    			<?php $this->get_content_template( 'mbcontent', get_post_format() ); ?>
    		
    		<?php endwhile; ?>
    		
    		<?php /** End Posts **/ ?>
    
    		<?php /** Begin Pages Navigation **/ ?>
    			
    		<?php if( $gantry->get( 'pagination-enabled', '1' ) && $custom_query->max_num_pages > 1 ) gantry_pagination($custom_query); ?>
    
    		<?php /** End Pages Navigation **/ ?>
    	
    	<?php else : ?>
    																															
    		<h1>
    			<?php _re('Sorry, but nothing matched your search criteria. Please try again with some different keywords.'); ?>
    		</h1>
    													
    	<?php endif; ?>
    													
    	<?php wp_reset_query(); ?>

    Listing mbcontent.php:

    
    <div class="mboss">
    
        <div class="mbhead">
            <div class="mbimage"><?php echo types_render_field( "logo", array() );?></div>
            <div class="mbname">
    	        <div class="mbtitle"><?php the_title(); ?></div>
    	        <div class="mbratingb">
    	            
    	            <div>
    	                <img src="/wp-content/themes/rt_acacia_wp/images/like.jpg" style="float: right;">
    	                <div class="mbratingvalue">
    	                    <?php echo types_render_field("rating", array()); ?>
    	                </div>
    	                <div style="font-weight: bold; font-size: 70%; text-align: center;">рейтинг</div>
    	            </div>
    	        </div>
    	    </div>
    	    <div class="mbusluga"><?php echo types_render_field("allserv",array());?></div>
    	</div>
    	<div class="mbcontact">
    	    <?php if (types_render_field("namep",array()) != ""):
                    echo '<div> <img src="/wp-content/themes/rt_acacia_wp/images/icons/iman.png" style="margin-right: 7px; margin-bottom: 4px;">'.types_render_field("namep",array()).'</div>';
                    endif;
            ?>
            <?php if (types_render_field("phonep",array()) != ""):
                    echo '<div><img src="/wp-content/themes/rt_acacia_wp/images/icons/iphone.png" style="margin-right: 7px; margin-bottom: 4px;">'.types_render_field("phonep",array()).'</div>';
                    endif;
            ?>
            <?php if (types_render_field("email",array()) != ""):
                    echo '<div> <img src="/wp-content/themes/rt_acacia_wp/images/icons/imail.png" style="margin-right: 7px; margin-bottom: 4px;">'.types_render_field("email",array()).'</div>';
                    endif;
            ?>
    	</div>
    	<div style="display: inline-block; width: 100%;">
    	    <div style="float: left;">
            	<div class="mblabael">
            	    <strong>Документы: </strong>
            	    <?php
            	        $check = types_render_field("docs",array());
            	        $checkimg = "";
            	        if ($check == 1): 
            	            $checkimg = "/wp-content/themes/rt_acacia_wp/images/check1.jpg";
            	        else:
            	            $checkimg = "/wp-content/themes/rt_acacia_wp/images/check0.jpg";
            	        endif;
            	    ?>
            	    <img src="<?php echo $checkimg;?>">
            	</div>
            	<div class="mblabael">
            	    <strong>Портфолио: </strong>
            	    <?php
            	        $check = types_render_field("portfolio",array());
            	        $checkimg = "";
            	        if ($check == "есть"): 
            	            $checkimg = "/wp-content/themes/rt_acacia_wp/images/check1.jpg";
            	        else:
            	            $checkimg = "/wp-content/themes/rt_acacia_wp/images/check0.jpg";
            	        endif;
            	    ?>
            	    <img src="<?php echo $checkimg;?>">
            	    <?php if ($check == "есть"): echo types_render_field("urlportfolio", array("title" => "посмотреть","target" => "_blank")); endif;?>
            	</div>
            </div>	
        	<div class="mblabael" style="float: right; text-align: right; font-weight: bold; color: #1319DF;">
        	    <strong style="color: #000;">Опыт работы: </strong>
        	    <?php 
                    $number = types_render_field("stazh", array("style" => "FIELD_NAME : $ FIELD_VALUE")); 
                    $after = array('год','года','лет');
                    $cases = array (2, 0, 1, 1, 1, 2);
                    echo $number.' '.$after[ ($number%100>4 && $number%100<20)? 2: $cases[min($number%10, 5)] ];
                ?>
        	</div>
    	</div>
    	<div class="spoiler-wrapper1">
        <div class="spoiler1 folded">Подробнее</div>
        <div class="spoiler1-text" >
                <?php if (types_render_field("allserv",array()) != ""):
                    echo '<div class="mblabaelmore"> <strong>Основной вид деятельности: </strong>'.types_render_field("shortdesc",array()).'</div>';
                    endif;
                ?>
                <?php if (types_render_field("needobject",array()) != ""):
                    echo '<div class="mblabaelmore"> <strong>Интересующие объекты: </strong>'.types_render_field("needobject",array()).'</div>';
                    endif;
                ?>
                <?php if (types_render_field("instrument",array()) != ""):
                    echo '<div class="mblabaelmore"> <strong>Имеющийся инструмент, приспособления, техника: </strong>'.types_render_field("instrument",array()).'</div>';
                    endif;
                ?>
                <?php if (types_render_field("mesta",array()) != ""):
                    echo '<div class="mblabaelmore"> <strong>Собственные производственные помещения: </strong>'.types_render_field("mesta",array()).'</div>';
                    endif;
                ?>
                <?php if (types_render_field("rabuslov",array()) != ""):
                    echo '<div class="mblabaelmore"> <strong>Желаемые условия и место работы: </strong>'.types_render_field("rabuslov",array()).'</div>';
                    endif;
                ?>
                <?php if (types_render_field("matpostavka",array()) != ""):
                    echo '<div class="mblabaelmore"> <strong>Материал: </strong>'.types_render_field("matpostavka",array()).'</div>';
                    endif;
                ?>
                <?php if (types_render_field("dopserv",array()) != ""):
                    echo '<div class="mblabaelmore"> <strong>Дополнительные услуги: </strong>'.types_render_field("dopserv",array()).'</div>';
                    endif;
                ?>
                <?php if (types_render_field("rabcount",array()) != ""):
                    echo '<div class="mblabaelmore"> <strong>Количество рабочих: </strong>'.types_render_field("rabcount",array()).'</div>';
                    endif;
                ?>
        </div>
        </div>
    	
    </div>

    In result, after search button click, open clear page with html:
    <html><head></head><body></body></html>

    If “Use a custom template for results?” disabled, all it’s Ok.

    Ross Moderator
    #2497

    Thats certainly strange, I’m not familiar with that theme but it seems to be doing some non standard stuff!

    Do you have a link I could look at?

    Anonymous
    #2513


    I too think it Gantry problem.
    I decided to use original search.php.
    The topic can be closed. I will be grateful if you help me to resolve other extremely important issue .

Viewing 5 posts – 1 through 5 (of 5 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.