Forums Forums Search & Filter Pro Extra space in search results

Viewing 10 posts - 1 through 10 (of 23 total)
  • Anonymous
    #56361

    [trevorsf split this thread from https://support.searchandfilter.com/forums/topic/extra-space-in-search-results/ to make Melinda Cooper the OP]

    Hi, we’ve already created our own templates as per the instructions from Ross. However, we are still having issues with extra paragraphs getting though into our results page. See this page for an example: http://dev.rhgrp.com/CreativeHomes/properties/

    Trevor
    #56378

    Can you copy and paste here your results.php template file contents, inside code tags (one before, one after, they are little back ticks from the key next to the 1 key)?

    Anonymous
    #56455
    <?php
    /**
     * Search & Filter Pro 
     *
     * Sample Results Template
     * 
     * @package   Search_Filter
     * @author    Ross Morsali
     * @link      http://www.designsandcode.com/
     * @copyright 2015 Designs & Code
     * 
     * Note: these templates are not full page templates, rather 
     * just an encaspulation of the your results loop which should
     * be inserted in to other pages by using a shortcode - think 
     * of it as a template part
     * 
     * This template is an absolute base example showing you what
     * you can do, for more customisation see the WordPress docs 
     * and using template tags - 
     * 
     * http://codex.wordpress.org/Template_Tags
     *
     */
    
    if ( $query->have_posts() )
    {
    	?>
    	
    	Found <?php echo $query->found_posts; ?> Results<br />
    	Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
    	
    	
    	 <div style="width:100%;">
    
    	
                
                   		<?php
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
    	<div class="result">
    	
    		<?php if (get_field('property_main_image') != '') { ?>                     
             <img />" alt="" width="400px" />   
                       <div class="status"><?php echo get_field('status'); ?></div>
                       <div class="details">
                        
                           <?php
                           
                            echo '<h4>$' .  get_field('price') . ' </h4>';                           
                                                    
                            
    						echo '<p>' . get_field('address') . '<br>';
    						echo get_field('city') . ', '; echo get_field('state'); echo get_field('zip') . '</p>';   
    
    						echo '<p class="spex">' .  get_field('bedrooms') . ' BEDROOMS | '; echo get_field('bathrooms') . ' BATHROOMS<br>';
    	
    						echo '<span class="secondline">' .  get_field('square_footage') . ' SQ FT | '; echo get_field('garages') . ' CAR GARAGE</span>';
    
    	
    						echo '<span>MLS# ' .  get_field('MLS') . '</span></p>';?>
      					
      						
      					
      						<div class="linx">	
      							
      							<a href="#"><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_Photos_Grey.png" alt="see photo gallery" /></a> 
      							<a target="_blank">"><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_MapPin_Grey.png" alt="google map for location" /></a> 
      							<a target="_blank">"><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_Collateral_Grey.png" alt="brochure download" /></a>
      						</div><!--end linx-->
      					
      						<a>"><img src="/CreativeHomes/wp-content/uploads/2016/08/details-button.png" width="122" alt="details" /></a>
    
      					</div><!--end details-->
      	  							
      	
      				<div class="interact">
      					<span><?php the_favorites_button($post_id, $site_id); ?></span>
      					<span><img src="/CreativeHomes/wp-content/uploads/2016/08/check-icon.jpg" />Compare</span>
      					<span><?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>Share</span>
    
      				</div><!--end interact-->  
      				                     
    			</div><!--end result-->
    
    		<?php
    	}
    	?>	
    	</div>				
    	
    	
    	
    	<?php
    }
    else
    {
    	echo "No Results Found";
    }
    ?>
    Trevor
    #56464

    I can see a coding error on line 46:

    <?php if (get_field('property_main_image') != '') { ?>
    

    This if is started, but not ended. It needs to end before line 93.

    Anonymous
    #56465

    Thanks, I fixed that. Your plugin still adds extra paragraph tags and br tags.

    <?php
    /**
     * Search & Filter Pro 
     *
     * Sample Results Template
     * 
     * @package   Search_Filter
     * @author    Ross Morsali
     * @link      http://www.designsandcode.com/
     * @copyright 2015 Designs & Code
     * 
     * Note: these templates are not full page templates, rather 
     * just an encaspulation of the your results loop which should
     * be inserted in to other pages by using a shortcode - think 
     * of it as a template part
     * 
     * This template is an absolute base example showing you what
     * you can do, for more customisation see the WordPress docs 
     * and using template tags - 
     * 
     * http://codex.wordpress.org/Template_Tags
     *
     */
    
    if ( $query->have_posts() )
    {
    	?>
    	
    	Found <?php echo $query->found_posts; ?> Results<br />
    	Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
    	
    	
    	 <div style="width:100%;">
    
    	
                
                   		<?php
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
    	<div class="result">
    	
    		                   
             <div class="photo">
             <?php if (get_field('property_main_image') != '') { ?>
    			<img src="<?php the_field('property_main_image'); ?>" alt="<?php get_field('address'); ?>" />
    		<?php } else { ?>
    			<img src="/CreativeHomes/wp-content/uploads/2016/08/image-placeholder-500x500.jpg"  alt="image coming soon" />
    		<?php } ?>
    		</div>
             
                       <div class="status"><?php echo get_field('status'); ?></div>
                       <div class="details">
                        
                           <?php
                           
                            echo '<h4>$' .  get_field('price') . ' </h4>';                           
                                                    
                            
    						echo '<p>' . get_field('address') . '<br>';
    						echo get_field('city') . ', '; echo get_field('state'); echo get_field('zip') . '</p>';   
    
    						echo '<p class="spex">' .  get_field('bedrooms') . ' BEDROOMS &bull; '; echo get_field('bathrooms') . ' BATHROOMS<br>';
    	
    						echo '<span class="secondline">' .  get_field('square_footage') . ' SQ FT &bull; '; echo get_field('garages') . ' CAR GARAGE</span>';
    
    	
    						echo '<span>MLS# ' .  get_field('MLS') . '</span></p>';?>
      					
      						
      					
      						<div class="linx">	
      							
      							<a href="#"><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_Photos_Grey.png" alt="see photo gallery" /></a> 
      							<a target="_blank" href="<?php echo get_field('map_it_link'); ?>"><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_MapPin_Grey.png" alt="google map for location" /></a> 
      							<a target="_blank" href="<?php echo get_field('download_floorplan'); ?>"><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_Collateral_Grey.png" alt="brochure download" /></a>
      						</div><!--end linx-->
      					
      						<a href="<?php echo get_permalink(); ?>"><img src="/CreativeHomes/wp-content/uploads/2016/08/details-button.png" width="122" alt="details" /></a>
    
      					</div><!--end details-->
      	  							
      	
      				<div class="interact">
      					<span><?php the_favorites_button($post_id, $site_id); ?></span>
      					<span><img src="/CreativeHomes/wp-content/uploads/2016/08/check-icon.jpg" />Compare</span>
      					<span><?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>Share</span>
      					<div class="clearfix">&nbsp;</div>
    
      				</div><!--end interact-->  
      				                     
    			</div><!--end result-->
    
    		<?php
    	}
    	?>	
    	</div>				
    	
    	
    	
    	<?php
    }
    else
    {
    	echo "No Results Found";
    }
    ?>
    Trevor
    #56472

    If I look at one of the results panels, for example for 14980-37th-st-north-2 (@ $899,900), where is the space?

    Anonymous
    #56474

    There are lots of extra paragraph tags added, especially around where I put html comments. Here is what is being returned as one result:

    <div class="result">
    <div class="photo">
             			<img src="/CreativeHomes/wp-content/uploads/2016/08/image-placeholder-500x500.jpg" alt="image coming soon">
    				</div>
    <div class="status">available</div>
    <div class="details">
    <h4>$899,900 </h4>
    <p>14980 37th St. North<br>Stillwater, MN55082</p>
    <p class="spex">5 BEDROOMS • 4.5 BATHROOMS<br><span class="secondline">4,466 SQ FT • 3 CAR GARAGE</span><span>MLS# </span></p>
    <div class="linx">
    <p>  							<a href="#"><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_Photos_Grey.png" alt="see photo gallery"></a><br>
      							<a target="_blank" href="https://www.google.com/maps/place/14980+37th+St+N,+Stillwater,+MN+55082/@45.0030098,-92.804646,17z/data=!3m1!4b1!4m5!3m4!1s0x52b2caf558ae6501:0xaf6a6de1897512d0!8m2!3d45.003006!4d-92.802452"><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_MapPin_Grey.png" alt="google map for location"></a><br>
      							<a target="_blank" href=""><img src="/CreativeHomes/wp-content/uploads/2016/08/CH_Button_Collateral_Grey.png" alt="brochure download"></a>
      						</p></div>
    <p><!--end linx--></p>
    <p>  						<a href="http://dev.rhgrp.com/CreativeHomes/property/14980-37th-st-north-2/" class="button">Details</a></p></div>
    <p><!--end details--></p>
    <div class="interact">
      					<span><button class="simplefavorite-button" data-postid="858" data-siteid="1" data-favoritecount="1"><img src="http://dev.rhgrp.com/CreativeHomes/wp-content/uploads/2016/08/heart-icon.jpg"> Save</button></span><br>
      					<span><img src="/CreativeHomes/wp-content/uploads/2016/08/check-icon.jpg">Compare</span><br>
      					<span>
    <div style="line-height: 16px;" class="a2a_kit addtoany_list" data-a2a-url="http://dev.rhgrp.com/CreativeHomes/property/14980-37th-st-north-2/" data-a2a-title="14980 37th St North"><a class="a2a_dd addtoany_share_save" href="https://www.addtoany.com/share#url=http%3A%2F%2Fdev.rhgrp.com%2FCreativeHomes%2Fproperty%2F14980-37th-st-north-2%2F&title=14980%2037th%20St%20North&description="><img src="http://dev.rhgrp.com/CreativeHomes/wp-content/uploads/2016/08/arrow-icon.jpg" alt="Share"></a></div>
    <p>SHARE</p>
    <div class="clearfix">&nbsp;</div>
    <p></p></span></div>
    <p><!--end interact-->  </p></div>
    <p><!--end result--></p>
    Trevor
    #56511

    Hi

    All I can think of is to try instead to echo those comments, so … this:

    <!--end details-->

    becomes this:

    <?php echo '<!--end details-->';?>

    Anonymous
    #57155

    The extra paragraph tags exist when the page is first loaded but not after you click the reset button. This causes a lot of headaches for styling. Is there a fix for the paragraph tags getting added?

    Trevor
    #57177

    Did you change the comment parts as suggested? It is something to to with the parser in your theme I think. You can test this by temporarily taking out the comments.

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