Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 171 through 180 (of 1,224 total)
  • Author
    Search Results
  • #241531

    Trevor
    Participant

    Translation files may well come in V3 (due soon).

    Which Display Results method are you using? For example, if the form is ‘Using a Shortcode’ method for the results, then you would need to replace the text strings you will find in the results.php template used by the ‘As a Shortcode’ method you are using, as outlined here:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results

    By making a copy of the file and placing it in a sub-folder of a child theme folder, as shown in the above guide, updates do not affect it.

    #241471

    In reply to: Language


    Trevor
    Participant

    As with my reply to your permalink thread, which Display Results method are you using? For example, if the form is ‘Using a Shortcode’ method for the results, then you would need to replace the text strings you will find in the results.php template used by the ‘As a Shortcode’ method you are using, as outlined here:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results

    If that does not help, are you able to send me a live link/URL to your search page so I can take a look?

    #241467

    In reply to: Insert permalink


    Trevor
    Participant

    As with my reply to your other thread, which Display Results method are you using? For example, if the form is ‘Using a Shortcode’ method for the results, then you would need to edit the results.php template file to add such a button. You would need to customize the code in the results.php template used by the ‘As a Shortcode’ method you are using, as outlined here:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results

    If that does not help, are you able to send me a live link/URL to your search page so I can take a look?

    #240576

    Trevor
    Participant

    If the file is named results.php then no, there is no need to have individual identical templates, you can use just that one. As soon as you make one with the number, it will use that instead.

    #240301

    In reply to: Numbered Pagination


    Trevor
    Participant

    Can you try this. Return the code back to how it is in the original results.php file, and install and use the WP-PageNavi plugin?

    #240166

    In reply to: Numbered Pagination


    Anonymous
    Inactive

    Hi Trevor,

    I’m not sure where I define the ajax container. I copied the default results.php, pasted in an overriding template and made slight modifications to integrate Foundation CSS classes and pull in ACF field values.

    Here’s my results template 475.php

    <?php
    /**
     * Search & Filter Pro 
     *
     * Sample Results Template
     * 
     * @package   Search_Filter
     * @author    Ross Morsali
     * @link      https://searchandfilter.com
     * @copyright 2018 Search & Filter
     * 
     * 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
     *
     */
    ?>
    
    <?php if ( $query->have_posts() ) : ?>
    
    <div class="grid-x grid-padding-x grid-margin-x resources-results-list">
    		
    	<?php 
    	
    	while ($query->have_posts()) : $query->the_post(); 
    	
    		$resource_link_type = get_field('resource_link_type');
    	
    		if( $resource_link_type == 'internal') :
    	
    			$link_dest = get_field('resource_internal');
    			$link_attr = '';
    	
    		elseif( $resource_link_type == 'external') :
    	
    			$link_dest = get_field('resource_external');
    			$link_attr = ' target="_blank"';
    	
    		elseif( $resource_link_type == 'download') :
    	
    			$link_dest = get_field('resource_download');
    			$link_attr = ' target="_blank" download';
    	
    		endif;
    	
    	?>
    		<div class="small-12 medium-6 large-4 cell">
    			<div class="resource-item">
    				<div class="resource-image text-center">
    					<?php the_post_thumbnail( 'full' ); ?>
    				</div>
    				<h3 class="resource-title"><?php the_title(); ?></h3>
    				<div class="resource-type"><?php the_field('resource_type'); ?></div>
    				<div class="resource-content">
    					<?php the_content(); ?>
    				</div>
    				<div class="resource-link">
    					<a href="<?php echo $link_dest; ?>" class="button"<?php echo $link_attr; ?>><?php the_field('resource_link_text'); ?></a>
    				</div>
    			</div>
    		</div>
    	<?php endwhile; ?>
    		
    </div>
    
    <div class="grid-x grid-padding-x pagination align-center">
        <?php /*
    	<div class="cell shrink nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div>
    	<div class="cell shrink nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
        */ ?>
        
        <div class="cell shrink">
            <?php numbered_pagination(); ?>
        </div>
        
    </div>
    	
    			
    <?php 
    
    else : 
    
    ?>
    <div class="grid-x grid-padding-x">
    	<div class="small-12 cell">
    		<span>No Results Found</span>
    	</div>
    </div>
    <?php endif; ?>

    Anonymous
    Inactive

    We found the issue, it wasn’t the PHP version or the plugin, but our custom results.php 🙂

    We got a hold of the php error logs and they finally gave us a clue. One server had short_open_tag=On and the other didn’t, so it couldn’t read some key parts of the file.

    Thank you for the help anyway, you were very prompt!


    Trevor
    Participant

    You need to modify the code in the results.php to this:

    <?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 this file is called directly, abort.
    if ( ! defined( 'ABSPATH' ) ) {
    	exit;
    }
    
    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(70)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
    	
    	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 class="pagination">
    		
    		<div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
    		<?php
    			/* example code for using the wp_pagenavi plugin */
    			if (function_exists('wp_pagenavi'))
    			{
    				echo "<br />";
    				wp_pagenavi( array( 'query' => $query ) );
    			}
    		?>
    	</div>
    	
    	<?php
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
    		<div>
    			<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    			
    			<p><br /><?php the_excerpt(); ?></p>
    			<?php 
    				if ( has_post_thumbnail() ) {
    					echo '<p>';
    					the_post_thumbnail("small");
    					echo '</p>';
    				}
    			?>
    			<p><?php the_category(); ?></p>
    			<p><?php the_tags(); ?></p>
    			<p><small><?php the_date(); ?></small></p>
    			
    		</div>
    		
    		<hr />
    		<?php
    	}
    	?>
    	Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
    	
    	<div class="pagination">
    		
    		<div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
    		<?php
    			/* example code for using the wp_pagenavi plugin */
    			if (function_exists('wp_pagenavi'))
    			{
    				echo "<br />";
    				wp_pagenavi( array( 'query' => $query ) );
    			}
    		?>
    	</div>
    	<?php
    }
    else
    {
    	echo "No Results Found";
    }
    }
    ?>

    Trevor
    Participant

    Yes, the shortcode method would do as you want, but the layout and appearance of the results are basic. You would most likely want to edit the exemplar results.php template file to meet your needs.

    It is described here (there is only one setting change that you need to make to the form):

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/

    #238950

    Trevor
    Participant

    Can I just check though, you didn’t edit or modify any of our files, like the results.php file? As that might get overwritten.

Viewing 10 results - 171 through 180 (of 1,224 total)