Forums › Forums › Search & Filter Pro › Only title search
- This topic has 1 reply, 2 voices, and was last updated 5 years ago by Trevor.
-
Anonymous(Private) November 28, 2019 at 5:00 pm #227953
Hello, I use the shortcode filter, it is possible that when searching through text strings, I only look in the title instead of also looking in the description?
For example I have a title called ACCES WORLD, and in the description “world” appears, that only results appear per title, instead of description.And another question, the results show Taxonomies that I have created, but can only be accessed by clicking on the title, would it be possible that it was also accessible with the highlighted image?
Regards, and thank you very much
Trevor(Private) November 28, 2019 at 6:12 pm #227954Two answers.
The title only search. You will need to follow the instructions for using the 3rd party Relevanssi plugin, here:
https://searchandfilter.com/documentation/3rd-party/relevanssi/
You will need to look through the Relevanssi plugin options for what it searches, and whether it searches for whole words etc. I would not recommend the relevance option in your case.
The image to be clickable. Follow these instructions to be able to modify the results.php file:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results
In the standard results.php, see lines 56-62 (yours may now be different) for the image code:
<?php if ( has_post_thumbnail() ) { echo '<p>'; the_post_thumbnail("small"); echo '</p>'; } ?>
This would need to be changed to:
<?php if ( has_post_thumbnail() ) { ?> <a alt="<?php esc_html(get_the_post_thumbnail_caption());?>" href="<?php the_permalink(); ?>"><?php the_post_thumbnail("medium");?></a> <?php } ?>
Notice I changed the image size also. There are many different sizes you can pick. Normally, the smallest is
"thumb"
-
AuthorPosts