Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 661 through 670 (of 1,224 total)
  • Author
    Search Results
  • #128255

    Anonymous
    Inactive

    Hey!

    I’m in the process of customizing the results of my Search & Filter results from within public_html/wp-content/themes/salient/search-filter/results.php. I see a number of PHP variables for various portfolio attributes, such as the_title() for the title and the_excerpt() for the excerpt. But I can’t seem to find the PHP variable for the External Project URL. I’ve made a few attempts (the_external_project_url(), the_external_url(), etc.) but haven’t gotten anything to work.

    What is the PHP variable for the External Project URL attribute of a Portfolio item?

    #128115

    Trevor
    Participant

    Ah, I see. You are using the Shortcade Display Results method?

    Did you copy the results.php file from our plugin templates folder to customise it?

    If you did this, also inside that folder was a template to be used for infinite scroll. It must be renamed to results.php, but its contents have been re-written for this feature. Or you can copy out of that file and past into your copy of the results.php file.

    #127072

    Trevor
    Participant

    I think you are wanting to make the fields in the search form (or at least some of them) work horizontally. The actual CSS required would vary from form to form and theme to theme, but if you search for the phrase:

    horizontal form custom css you will find many examples on this forum.

    You appear to be using the Shortcode Display results method and the guide to customising the results.php template is here.


    Trevor
    Participant

    Hi Nathan

    I split this from the other thread, just in case we need to do any private replies.

    The limiting factor in whether you can filter a grid made by any theme or plugin is what that theme or plugin is and how it makes the grid.

    From experience, I know that this is very difficult to do with Salient, and that other users (often with my coding help), have used the shortcode results method and I have made them a custom results.php. Having done many now for recipe sites, it doesn’t take me long!

    Please see my follow up reply about a chat on Skype.

    #126468

    Trevor
    Participant

    The search form and results page have to be different. Each will have its own post ID. Lets us say you have two search forms, ID #2345 and ID #3456

    Then you can have the results.php named 2345.php and 3456.php

    The documentation for this is here:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

    #126361

    Trevor
    Participant

    Hi

    I visited both pages given and looked at the location field on both. If you do a search for Appellate, both pages have the location missing.

    With the shortcode method, I presume that you have a custom results.php template file in your (child) theme folder, in a sub-folder called search-filter?

    Are you able to show me the contents of that file (if pasted here, it needs to go inside two code tags – the back tick key (to the left of the main keyboard 1 key)?

    #126083

    In reply to: Layout


    Trevor
    Participant

    This is the customised results.php to work in your child theme of the Primrose theme, making it look like the grid you made with SiteOrigin:

    <?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 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>
    
    	<div id="sf-custom-results" class="panel-layout">
    	<?php
    	$result_counter=0;
    	$data_index=0;
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
    		<div class="sf-results-row panel-grid panel-no-style">
    
    			<div class="sf-results-leftcol panel-grid-cell">
        <div class="so-panel widget widget_sow-image panel-first-child panel-last-child" data-index="<?php echo $data_index++;?>">
    					<div class="so-widget-sow-image so-widget-sow-image-default-eef982a7180b">
          <div class="sow-image-container">
    						<?php 
    							if ( has_post_thumbnail() ) {
    								the_post_thumbnail("full");
    							}
    						?>
    						</div>
    					</div>
        </div>
    			</div>
    
    			<div class="sf-results-rightcol panel-grid-cell">
    				<div class="so-panel widget widget_sow-editor panel-first-child panel-last-child" data-index="<?php echo $data_index++;?>">
    					<div class="so-widget-sow-editor so-widget-sow-editor-base">
    						<h3 class="widget-title"><?php the_title(); ?></h3>
    						<div class="siteorigin-widget-tinymce textwidget">
    							<header class="w2dc-listing-header"><p>blah</p></header>
    							<p><br /><?php the_excerpt(); ?></p>
    						</div>
    					</div>
    				</div>
    			</div>
    
    		</div>
    		
    		<?php
    			//$result_counter++;
    	}
    	?>
      </div>
      <div>Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?></div>
    	
    	<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";
    }
    ?>

    This is the Custom CSS that accompanies it:

    .sf-results-leftcol.panel-grid-cell {
        width: 25% !important;
        width: calc(25% - ( 0.750000001875 * 40px)) !important;
    }
    .sf-results-rightcol.panel-grid-cell {
        width: 75% !important;
        width: calc(75% - ( 0.249999998125 * 40px)) !important;
    }
    #sf-custom-results .so-panel {
        margin-bottom: 0;
    }
    #sf-custom-results div.sf-results-row:nth-last-child(2) {
        margin-bottom: 0;
    }
    #sf-custom-results .sf-results-row {
        -webkit-align-items: flex-start;
        align-items: flex-start;
        margin-bottom: 40px;
    }
    @media (max-width: 767px) {
        .sf-results-leftcol.panel-grid-cell,
        .sf-results-rightcol.panel-grid-cell {
            width: 100% !important;
        }
        .sf-results-row {
            -webkit-flex-direction: column;
            -ms-flex-direction: column;
            flex-direction: column;
        }
        .sf-results-row .sow-image-container {
            text-align: center;
        }
    }
    #125432

    Trevor
    Participant

    You are using the Shortcode Display Results method, and so should be using a copy of the results.php template, placed in your theme folder, as described here.

    You need to edit that file and find where the thumbnail is being output. My suspicion is that it is using size "thumb" but mabe you could use "small" instead?

    #125261

    Trevor
    Participant

    You would need to customise the results.php file, but make sure you follow these instructions:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

    In there, you simply delete the lines that have the bits that you want to remove.


    Anonymous
    Inactive

    Hi,

    I am trying to use this code in the results.php file:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1274)->current_query();
    $searchTerm = $sf_current_query->get_search_term();
    echo $searchTerm;

    but I get no results

Viewing 10 results - 661 through 670 (of 1,224 total)