I’ve set up this query to show all Post from certain Custom Post Types but I would like to alter the query and change the featured image to a specific icon that relates to the Post Type instead of the set Featured Images
function my_query_by_post_types( $query ) {
$query->set( 'post_type', [ 'articles', 'events' ] );
}
add_action( 'elementor/query/all_post_types', 'my_query_by_post_types' );
For example instead of showing the featured images for the events, I’d like to show a calendar Icon for all the posts that appear.
2
Answers
You can do this using WP_Query, In your
front-page.php
you can put thisGet the $thumbnail_id of the image you want to set from "Media Library" and hovering/pressing Edit button .
You can filter the featured image output conditionally