Support Forums

Hey there, it looks like you've been redirected from designsandcode.com - as you can see we have a new home - read more

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Results count… can't make it work

Tagged: ,

Viewing 10 posts - 1 through 10 (of 19 total)
  • Javier Riveros
    #104844

    Can you help me to get results count work fine? I just can’t! 🙁

    Trevor Moderator
    #104941

    I would need to see the page with the search on, and a more detailed of what is wrong (e.g. term xxx should have 10, but has only 5).

    Note that the most common reason for ‘No Results Found’ is an unfinished rule on the Post Meta settings tab (the last field is empty) and for wrong counts it is often multiple lines of includes (which act as AND in operation and thus reduce results) in the Tags, Categories & Taxonomies settings tab.

    Javier Riveros
    #104960

    Oh, thanks. This is the link:
    http://stude.masterbip.com/test/
    I have tried several code with no results, no text, only “results” text.

    Thanks!

    Trevor Moderator
    #104964

    OK. I did a quick random test, by selecting T. OPERACION -> Alquiler (2) and it gives me two results. See here:

    http://stude.masterbip.com/test/?_sft_tipo-operacion=alquiler&_sfm_precio=0+6000

    BUT, see it adds the range? Any posts with no value in Precio will be excluded.

    Javier Riveros
    #104968

    Sorry you don’t understand me. In my first post and title I am talking about RESULTS COUNT not results itself…
    The search works fine!
    The ammount of results in a number does not!
    Look at “RESULTADOS DE BUSQUEDA: INMUEBLES”
    Should be “RESULTADOS DE BUSQUEDA: 2 INMUEBLES”
    Results count!

    Thanks!

    Trevor Moderator
    #104981

    Ah, I see. But that text is made by your theme, so it would depend what you theme does here to find the count.

    Javier Riveros
    #104985

    I am the developer of the theme. That’s why I need your help please as you exactly says in your refund policies, please, help me to figure out what is wrong.

    Thanks!

    Trevor Moderator
    #105004

    Ah. Is it based on a blank WordPress template theme? If so, what code are you using around that heading? In PHP I mean. You can paste code here IF you put it in between code ticks (on my keyboard it is the button to the left of the main 1/! key), one before and one after the code.

    Javier Riveros
    #105016

    Many thanks. No it is not. We design and program themes from scratch.
    This is the whole code

    <?php 
    /*
    Template name: Buscador de Propiedades
    */
    
    get_header();
    ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <div class="encabezado page-encabezado buscadorinmueble-encabezado" style="background-image:url(
    	<?php 
        if ( has_post_thumbnail()) {
        $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'encabezado' );
        $url = $thumb['0'];
        echo $url;
        }
        else{
            echo of_get_option('mb_page_encabezado_fondo');
        }
        ?>
        );">
        <div class="grid grid-pad">
            <div class="col-1-1 mobile-col-1-1">
                <h1 class="text-center"><?php the_title();?></h1>
            </div>
        </div>
    </div>
    <?php endwhile; ?>
    <section>
    
    	<div class="section prop-filtro">
            <div class="grid grid-pad">
            	<div class="col-1-1 mobile-col-1-1">
                	<div id="prop_buscador_show_wrap" style="display:none;">
    					<a href="void(0);"><?php _e('Mostrar Filtros','weyketing'); ?></a>
    				</div>
    	            <div id="prop_buscador_referencia" class="prop-buscador" style="">
                		<?php get_template_part( 'propid', 'searchform' ); ?>
                    </div>
                	<div id="prop_buscador" class="prop-buscador prop-buscador-grande activado" style="">
                	<?php echo do_shortcode(of_get_option('mb_prop_buscador_form')); ?>
    	            <a href="void(0);"><?php _e('Mas Filtros','weyketing'); ?></a>
                    <a href="void(0);"><?php _e('Menos Filtros','weyketing'); ?></a>
                    </div>
                </div>
            </div>
        </div>
        
    	<div class="section prop-featured">
        	<h2 class="titulo titulo-h2" style="text-align:center;"><span><?php _e('PROPIEDADES DESTACADAS','weyketing');?></span></h2>
            <div class="clear"></div>
            <div class="prop-featured-slider">
    			<?php
    			$args = array(
    				'post_type' => 'propiedad',
    				'posts_per_page' => 5,
    				'order' => 'DESC',
    				'orderby' => 'date',
    				'meta_key' => '_featured',
    				'meta_value' => 'yes'
    			);
    			query_posts( $args );
    			$contador = 1;
    			if ( have_posts() ) {
    			while ( have_posts() ) {
    			the_post();
    			
    			if ( has_post_thumbnail()) {
    				$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'propiedad-slider' );
    				$url = $thumb['0'];
    			}
    			else {
    				$url = of_get_option('mb_prop_thumb_default');
    			}
    
    			global $propiedad_mb;
    			$propiedad_mb->the_meta();
    			$prop_id = $propiedad_mb->get_the_value('referencia');
    			$prop_precio = $propiedad_mb->get_the_value('precio');
    			$prop_detalle_area_util = $propiedad_mb->get_the_value('area_util');
    			$prop_detalle_habitaciones = $propiedad_mb->get_the_value('habitaciones');
    			$prop_detalle_banos = $propiedad_mb->get_the_value('banos');
    			$prop_detalle_aparcamiento = $propiedad_mb->get_the_value('aparcamiento');
    			
    			?>
                <!-- REPEATER -->
                <div class="prop-feat-slider-item">
                	<img />" alt="<?php the_title(); ?>"/>
                    <div class="prop-feat-slider-content">
                    	<div class="grid grid-pad ">
                            <div class="col-8-12 mobile-col-1-1 propiedad-titulo">
                                <h2><?php the_title(); ?></h2>
                                <p>
                                    <?php _e('REF.','weyketing'); echo ' '.$prop_id;?>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
                                    <span>
                                        <?php
                                        $tipos = wp_get_post_terms($post->ID, 'tipo-operacion', array("fields" => "all"));
                                        foreach($tipos as $tipo) {
                                        echo $tipo->name;
                                        }
                                        ?>
                                    </span>
                                </p>
                            </div>
                            <div class="col-4-12 mobile-col-1-1 propiedad-precio">
                                <p><strong><?php echo number_format($prop_precio,0,',','.'); ?></strong><span>&euro;</span></p>
                            </div>
                        </div>
                        <div class="grid grid-pad">
                            <div class="col-9-12 mobile-col-1-1">
                                <ul class="prop-caract-principales">
                                    <li class="prop-caract">
                                        <img />"/>
                                        <?php _e('AREA UTIL','weyketing'); ?><br>
                                        <strong><?php echo $prop_detalle_area_util;?> M<sup>2</sup></strong>
                                    </li>
                                    <li class="prop-caract">
                                        <img />"/>
                                        <?php _e('HABITACIONES','weyketing'); ?><br>
                                        <strong><?php echo $prop_detalle_habitaciones;?></strong>
                                    </li>
                                    <li class="prop-caract">
                                        <img />"/>
                                        <?php _e('BANOS','weyketing'); ?><br>
                                        <strong><?php echo $prop_detalle_banos;?></strong>
                                    </li>
                                    <li class="prop-caract">
                                        <img />"/>
                                        <?php _e('APARCAMIENTO','weyketing'); ?><br>
                                        <strong><?php echo $prop_detalle_aparcamiento;?></strong>
                                    </li>
                                </ul>
                            </div>
                            <div class="col-3-12 mobile-col-1-1 text-right">
                            	<a>" class="boton" title="<?php _e('Ver: ','weyketing').' '.the_title(); ?>"><?php _e('VER MAS','weyketing'); ?> ></a>
                            </div>
                        </div>
                    </div>
                </div>
    			<!-- // REPEATER -->
    
    			<?php
                $contador = $contador + 1;
                } // end while
                } // end if
    			wp_reset_postdata();
                ?>
            </div>
            <script>
            jQuery(document).ready(function($){
            	$('.prop-featured-slider').slick({
    			adaptiveHeight: true,
    			autoplay: true,
    			infinite:true,
    			autoplaySpeed: 7000,
    			dots: true,
    			fade:true,
    			centerMode: true,
    			});
            });
            </script>
        <div class="clear" style="height:70px;"></div>
        </div>
        
    <!-- RESULTADOS DE BUSQUEDA -->
    	<div class="section prop-resultados">
        	<div class="grid grid-pad">
                <?php
    			$args = array('post_type' => 'propiedad');
    			$args['search_filter_id'] = 355;
    			query_posts( $args );
    			$contador = 1;
    			?>
        	<div class="resultados-top">
            	<div class="col-1-2 mobile-col-1-1">
                <?php
    			$total_results = $query->found_posts;
    			echo '<strong>'.__('RESULTADOS DE BUSQUEDA:','weyketing').'</strong> '.$total_results.' '.__('INMUEBLES','weyketing'); ?>
                </div>
                <div class="col-1-2 mobile-col-1-1 text-right">
                	<a href="history.back(-1);"><img />/inc/imagenes/iconos/btn-volver.png"/> <?php _e('VOLVER','weyketing'); ?></a>
                </div>
            </div>
            <div class="col-1-1 mobile-col-1-1">
    			<ul id="propresults" class="prop-items">
    				<?php
    					if ( have_posts() ) {
    
    					while ( have_posts() ) {
    					the_post();
    					
    					if ( has_post_thumbnail()) {
    						$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'propiedad-thumb' );
    						$url = $thumb['0'];
    					}
    					else {
    						$url = of_get_option('mb_prop_thumb_default');
    					}
    					
    					global $propiedad_mb;
    					$propiedad_mb->the_meta();
    					$prop_id = $propiedad_mb->get_the_value('referencia');
    					$prop_precio = $propiedad_mb->get_the_value('precio');
    					$prop_detalle_area_total = $propiedad_mb->get_the_value('area_total');
    					$prop_detalle_habitaciones = $propiedad_mb->get_the_value('habitaciones');
    					$prop_detalle_banos = $propiedad_mb->get_the_value('banos');
    					$prop_detalle_aparcamiento = $propiedad_mb->get_the_value('aparcamiento');
    					?>
    					<!-- REPEATER -->
                        <li id="propiedad_<?php the_ID(); ?>" class="prop-item prop-item-0<?php echo $contador; ?>">
                            <div class="flip-container" ontouchstart="this.classList.toggle('hover');">
                                <div class="flipper">
                                    <div class="prop-front">
                                        <div class="front-arriba">
                                            <div class="grid grid-pad">
                                            	<div class="col-1-1">
    		                                    	<h2><a>" title="<?php _e('Ver: ','weyketing').' '.the_title(); ?>"><?php the_title(); ?></a></h2>
            	                                </div>
                                            	<div class="col-1-2">
                                                	<p>
                                                    	<small><?php _e('REF.','weyketing'); echo ' '.$prop_id; ?></small>
    													<strong><?php echo number_format($prop_precio,0,',','.'); ?></strong><span>&euro;</span>
                                                    </p>
                                                </div>
                                            	<div class="col-1-2">
    												<?php
                                                    $tipos = wp_get_post_terms($post->ID, 'tipo-operacion', array("fields" => "all"));
                                                    foreach($tipos as $tipo) {
                                                    echo '<span class="prop-tipo">'.$tipo->name.'</span>';
                                                    }
                                                    ?>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="front-abajo">
                                        	<a>" title="<?php _e('Ver: ','weyketing').' '.the_title(); ?>"><img />" alt="<?php the_title(); ?>" class=""/></a>
                                        </div>
                                    </div>
                                    <div class="prop-back">
                                        <div class="back-arriba">
                                            <div class="grid grid-pad">
                                            	<div class="col-1-1">
    		                                    	<h2><a>" title="<?php _e('Ver: ','weyketing').' '.the_title(); ?>"><?php the_title(); ?></a></h2>
            	                                </div>
                                            	<div class="col-1-2">
                                                	<p>
                                                    	<small><?php _e('REF.','weyketing'); echo ' '.$prop_id; ?></small>
    													<strong><?php echo number_format($prop_precio,0,',','.'); ?></strong><span>&euro;</span>
                                                    </p>
                                                </div>
                                            	<div class="col-1-2">
    												<?php
                                                    $tipos = wp_get_post_terms($post->ID, 'tipo-operacion', array("fields" => "all"));
                                                    foreach($tipos as $tipo) {
                                                    echo '<span class="prop-tipo">'.$tipo->name.'</span>';
                                                    }
                                                    ?>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="back-abajo">
                                        	<div class="prop-caracteristicas">
                                            	<div class="grid grid-pad">
                                                	<div class="col-1-2">
                                                        <div class="prop-caract">
                                                            <img />"/>
                                                            <?php _e('AREA UTIL','weyketing'); ?><br>
                                                            <strong><?php echo $prop_detalle_area_util;?> M<sup>2</sup></strong>
                                                        </div>
                                                    </div>
                                                	<div class="col-1-2">
                                                        <div class="prop-caract">
                                                            <img />"/>
                                                            <?php _e('HABITACIONES','weyketing'); ?><br>
                                                            <strong><?php echo $prop_detalle_habitaciones;?></strong>
                                                        </div>
                                                    </div>
                                                	<div class="col-1-2">
                                                        <div class="prop-caract">
                                                            <img />"/>
                                                            <?php _e('BANOS','weyketing'); ?><br>
                                                            <strong><?php echo $prop_detalle_banos;?></strong>
                                                        </div>
                                                    </div>
                                                	<div class="col-1-2">
                                                        <div class="prop-caract">
                                                            <img />"/>
                                                            <?php _e('APARCAMIENTO','weyketing'); ?><br>
                                                            <strong><?php echo $prop_detalle_aparcamiento;?></strong>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <a>" class="boton" title="<?php _e('Ver: ','weyketing').' '.the_title(); ?>"><?php _e('VER MAS','weyketing'); ?></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </li>
                        <!-- //REPEATER -->
    					<?php
    					$contador = $contador + 1;
    					} // end while
    					?>
    <?php navegacion_numerica(); ?>
                        <?php
    					} // end if
    					wp_reset_postdata();
    					?>
                    </ul>
    				<div class="clear"></div>
                </div>
            </div>
        </div>
    </section>
    
    <?php get_footer(); ?>
    Trevor Moderator
    #105020

    I fixed the code to show as code.

    I see. You have a variable $total_results. You set this like this:

    $total_results = $query->found_posts;

    What Display Result method are you using in the form?

Viewing 10 posts - 1 through 10 (of 19 total)

The topic ‘Results count… can't make it work’ is closed to new replies.