Forums › Forums › Search & Filter Pro › Customizing Results
- This topic has 4 replies, 2 voices, and was last updated 5 years, 10 months ago by
Anonymous.
-
Trevor(Private) August 21, 2019 at 9:37 am #219404
Here is the Codex for the_post_thumbnail:
https://developer.wordpress.org/reference/functions/the_post_thumbnail/
You need to change
"small"
to"medium"
In the standard results.php, see lines 56-62 (yours may now be different):
<?php if ( has_post_thumbnail() ) { echo '<p>'; the_post_thumbnail("small"); echo '</p>'; } ?>
They need the link adding (with an alt to show the caption as a title), like this:
<?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 } ?>
I *think* that is right. I do not think that
esc_html(get_the_post_thumbnail_caption());
needs to be used with echo.You can use the same to put the caption on the page, like this:
<h3 class="image-caption"><?php esc_html(get_the_post_thumbnail_caption());?></h3>
and to get the description, I think some thing like this:
<div class="image-description> <?php echo get_post(get_post_thumbnail_id())->post_excerpt;?> </div>
You might need paragraph tags around the actual description, inside the div, like this:
<div class="image-description><p> <?php echo get_post(get_post_thumbnail_id())->post_excerpt;?> </p></div>
Let me know if that helps, or doesn’t work?
-
AuthorPosts