Forums › Forums › Search & Filter Pro › Custom search template problem
Tagged: Template
- This topic has 4 replies, 2 voices, and was last updated 10 years, 4 months ago by Anonymous.
-
Anonymous(Private) July 13, 2014 at 10:23 am #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(Private) July 14, 2014 at 1:33 pm #2465Hey 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(Private) July 14, 2014 at 7:27 pm #2484Hi, 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(Private) July 14, 2014 at 10:39 pm #2497Thats 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?
-
AuthorPosts