-
AuthorSearch Results
-
March 14, 2017 at 2:12 pm #96682
TrevorParticipantHi
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?
March 11, 2017 at 3:57 pm #96111Topic: Display results of image search II
in forum Search & Filter Pro
AnonymousInactiveHello 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
March 9, 2017 at 4:42 pm #95800In reply to: Display results of image search
TrevorParticipantHi 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 ourresults.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?
March 7, 2017 at 5:20 pm #95323In reply to: infinite scroll classipress theme
TrevorParticipantOK. 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?
March 6, 2017 at 7:17 pm #95003In reply to: Add Custom Field link to thumbnail in results
AnonymousInactiveHi, 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!
March 6, 2017 at 11:04 am #94836In reply to: Add Custom Field link to thumbnail in results
TrevorParticipantDoes 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.
March 2, 2017 at 11:54 am #93979In reply to: Get post categories and tags of results
TrevorParticipantAh. 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.
February 24, 2017 at 11:12 am #92704In reply to: Pagination not working
TrevorParticipantWhat 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.
February 21, 2017 at 6:49 pm #91736In reply to: Display author name in template
TrevorParticipantThe 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.
February 20, 2017 at 11:07 pm #91545In reply to: Display author name in template
TrevorParticipantThis 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?
-
AuthorSearch Results
-
Search Results
-
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