Hi,
Found this link and followed the instruction https://kriesi.at/support/topic/thumbnails-on-search-results-page/
i have the following error
Notice: Undefined index: size in /wamp/www/test/wp-content/themes/enfold/includes/loop-search.php on line 25
I just discovered code snippets plugin and find that cool! :D Is there a way to add to code snippets that don’t alter the parent theme?
Hi senso!
Please refer to this link: https://kriesi.at/support/topic/add-featured-image-to-search-results/
Cheers!
Yigit
Notice: Undefined variable: post_id in /var/www/html/wp-content/themes/enfold-child/includes/loop-search.php on line 34
Notice: Undefined variable: size in /var/www/html/wp-content/themes/enfold-child/includes/loop-search.php on line 34
Notice: Undefined variable: attr in /var/www/html/wp-content/themes/enfold-child/includes/loop-search.php on line 34
—————————————————————-
I have the above errors.
Hi!
Replace this line:
$searchthumb = get_the_post_thumbnail( $post_id, $size, $attr );
.. with:
$searchthumb = get_the_post_thumbnail( $post_id, 'square' );
Best regards,
Ismael
Hi Ismael,
I have this error
Notice: Undefined variable: post_id in /var/www/html/wp-content/themes/enfold-child/includes/loop-search.php on line 34
Hi!
replace Ismael’s last line with this:
$searchthumb = get_the_post_thumbnail( $_post->ID, 'square' );
Regards,
Andy
Hi Andy,
All the error messages disappeared after I turn off wordpress debug. define('WP_DEBUG', false);
Are there any issue that I should watch out for?
Hey!
Glad you figured it out!
If you run into any issues, please let us know
Regards,
Yigit
Hi Yigit,
Hiding the error messages by turning debug off, is it normal and will there be any issues with it?
Thanks