Home › Forums › Support › How to customize search results page to only show pages with a featured image This topic has 3 replies, 2 voices, and was last updated 6 months, 2 weeks ago by David. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts September 9, 2022 at 3:33 am #2337838 Jin I’ve tried to look for this and have read posts like this that talk about this problem, but only for Woocommerce. I’d like to do two things: 1) Have the search results page only show pages (and not posts) 2) Have the search results page only show pages that have a featured image Appreciate the the help. Thanks. September 9, 2022 at 6:29 am #2337960 DavidStaff Customer Support Hi there, try adding this PHP Snippet: function search_results_query( $query ) { if ( $query->is_search && !is_admin() ) { $query->set('post_type',array('page')); $meta_query = array( array( 'key'=>'_thumbnail_id', 'compare'=>'EXISTS', ), ); $query->set('meta_query',$meta_query); } } add_filter('pre_get_posts','search_results_query'); How to add PHP: https://docs.generatepress.com/article/adding-php/ Documentation: http://docs.generatepress.com/ Adding CSS: http://docs.generatepress.com/article/adding-css/ September 9, 2022 at 8:22 pm #2338575 Jin Thanks David appreciate it. September 10, 2022 at 5:01 am #2338805 DavidStaff Customer Support You’re welcome Documentation: http://docs.generatepress.com/ Adding CSS: http://docs.generatepress.com/article/adding-css/ Author Posts Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In