Forums Forums Search Search Results for 'results.php'

Viewing 10 results - 761 through 770 (of 1,224 total)
  • Author
    Search Results

  • Trevor
    Participant

    Hi

    You have the shortcode method enabled, and that uses the results.php template. But, when I go to your theme folder, and find the search-filter folder in that, I open the results.php file and it appears to be empty?

    #96111

    Anonymous
    Inactive

    Hello Trevor. I have minor questions.

    1st. Is there an easy way to display the search criteria in the results.php at the very beginning.
    2nd. The php function (?) the_content shows the thumbnail size. Is there an easy way to display mid size or large size?

    Best regards, Ernst Wilhelm

    #95800

    Trevor
    Participant

    Hi Ernst, hopefully that helped you move forward. To help others, you have a taxonomy called attachment_keyword and wanted to output the list of terms for each post in our results.php template (in this case with a comma and space after each. So this was the HP:

    <?php
    $all_att_kw = "";
    foreach (get_the_terms(get_the_ID(), 'attachment_keyword') as $att_kw) {
       $all_att_kw .= $att_kw->name . ", ";
    }
    echo  "<p>" . substr($all_att_kw, 0, -2) . "</p>";
    ?>

    Can I close this thread now?

    #95323

    Trevor
    Participant

    OK. Your theme has many templates. Do you know which template it should redirect to? By default most themes use search.php

    However, I remember that on your site you had a template called search-results.php, but I cannot see this in the list of templates in the child theme folder.

    This documentation page describes how to set up your own search template, so I wonder if that is what you did before, but maybe a theme update has deleted it?

    #95003

    Anonymous
    Inactive

    Hi, I took the results.php template from a sample I found in this forum, and it has always given 3 columns instead of 4. You can view the search at the development location here. Here is the entire current results.php:

    <?php
    /**
     * Search & Filter Pro 
     *
     * Sample Results Template
     * 
     * @package   Search_Filter
     * @author    Ross Morsali
     * @link      http://www.designsandcode.com/
     * @copyright 2015 Designs & Code
     * 
     * Note: This template has been modified to link search results 
     * images to artist pages that need to be defined in 
     * Custom Fields in the individual image post. 
     * 
     * The custom field is “artistpage” . 
     * The image in search results will incorporate the link you set  
     * for that custom field. If no link is defined, the image will
     * not link to an artist page.
     *
     * 
     *
     */
    
    if ( $query->have_posts() )
    {
    	?>
    	
    	<div class="sixteen columns">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>
    	
    	<?php
    	$column_count = 0;
    	$last_class = "";
    	while ($query->have_posts())
    	{
    		$query->the_post();
    
    		if ($column_count == 0) echo '<div class="sixteen columns">';
    		?>
    		<div class="one_fourth<?php echo $last_class;?>">
    			
    		
    <?php
      if ( has_post_thumbnail() ) { ?>
        <span class="responsive"><a href="<?php echo get_post_meta($query->post->ID,'artistpage',true); ?>">
    <?php the_post_thumbnail("small");?></a></span>
      <?php	} ?>		
    		</div>
    		
    		<?php
    	 $column_count ++;
     if ($column_count == 4) {
    			$column_count = 0;
    			echo '</div>';
    			$last_class = "";
    		}
    if ($column_count == 3) {
    			$last_class = " last";
    		}
    
    				}
    
    	if ($column_count > 0) echo '</div>';
    	?>
    	<div class="sixteen columns">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>
    	<?php
    }
    else
    {
    	echo "No Results Found";
    }
    ?>

    Thank you for your help!

    #94836

    Trevor
    Participant

    Does the previous post that has the results.php in give you the 3 columns grid, and if so, how did you change it (what did you change it to)? and do you have a sample page where I can see this in action? Sometimes, you code correctly a four column grid but a right margin on the last element of the row makes it appear on the next row.

    #93979

    Trevor
    Participant

    Ah. Then you will need to add the code to that custom template of your. You can refer to the wordpress Codex and additional code snippets can be found on the WordPress stackexchange site. also, in the plugin, you will find a templates folder, and in that a results.php file that has code that you can copy and paste (I think) for Tags and Categories, and much more besides that.

    #92704

    In reply to: Pagination not working


    Trevor
    Participant

    What happens if you put more normal pagination in? If you look in the plugin/templates folder, you will find a results.php template, look at the pagination section at the bottom.

    #91736

    Trevor
    Participant

    The display of the author is not part of Search and Filter as such. That is why I pointed you to the WordPress Codex. You can see some examples of the Codex in use in the results.php template that you will find in the wp-content/plugins/search-filter-pro/templates folder. You can see there how the permalink, the title, the categories, the tags, etc. are output.

    #91545

    Trevor
    Participant

    This would depend on the Display Results method you are using. Some depend on the theme template to do this, and the shortcode results method relies on the results.php template we supply with the plugin. See here for the customisation guide.

    Once you have a copy of that template, you would need to follow the coding advice in the WordPress Codex in how to display the author. as there are many ways you can do this, a specific answer is hard. With link to the author’s posts, or their profile? With their name , or nickname, or their avatar?

Viewing 10 results - 761 through 770 (of 1,224 total)