ID ); $exclude_types = array( '' ); $exclude_types = apply_filters( 'eat_exclude_types', $exclude_types ); // do nothing if the post has already a featured image set if ( $already_has_thumb ) { return; } // do the job if the post is not from an excluded type if ( ! in_array( $post_type, $exclude_types ) ) { // get first attached image $img = rv_auto_featured_image_catch_that_image( $post ); $attachment_id = attachment_url_to_postid( $img ); if ( $attachment_id ) { // add attachment ID add_post_meta( $post->ID, '_thumbnail_id', $attachment_id, true ); } } } // set featured image before post is displayed (for old posts) add_action( 'the_post', 'rv_auto_featured_image_add_thumbnail' ); // hooks added to set the thumbnail when publishing too add_action( 'new_to_publish', 'rv_auto_featured_image_add_thumbnail' ); add_action( 'draft_to_publish', 'rv_auto_featured_image_add_thumbnail' ); add_action( 'pending_to_publish', 'rv_auto_featured_image_add_thumbnail' ); add_action( 'future_to_publish', 'rv_auto_featured_image_add_thumbnail' ); function rv_auto_featured_image_catch_that_image( $post ) { // Find the images in the post_content. $output = preg_match_all( '//i', $post->post_content, $matches ); $first_img = isset( $matches[1][0] ) ? $matches[1][0]:''; // if no images found, do nothing if ( empty ( $first_img ) ) { return false; } return $first_img; } }Food – Tripadorn
Discovering Beautiful Zaragoza

Discovering Beautiful Zaragoza

The fifth largest city in Spain with over 700.000 inhabitants in its metropolitan area. Capital of the province of Aragon (and the millenary kingdom that bore its name). The city is a... Read more »
Ad Widget
Visiting wondrous Porto, Portugal

Visiting wondrous Porto, Portugal

Porto (Oporto in Portuguese) is a remarkable and extremely endearing city, blessed with a kind of mystical quality that remains long after one has left. The second largest city of Portugal, located... Read more »
A “brief” guide for a day in Venice

A “brief” guide for a day in Venice

There is no place quite like Venice. Built on 118 small islands, divided in six districts (called sestieri) its very existence is a testament to human ingenuity. This thousand year old floating... Read more »
A “brief” guide for a day in Venice

A “brief” guide for a day in Venice

There is no place quite like Venice. Built on 118 small islands, divided in six districts (called sestieri) its very existence is a testament to human ingenuity. This thousand year old floating... Read more »
Narni | Real-life Narnia in Italy

Narni | Real-life Narnia in Italy

The story goes that when a colleague of C.S Lewis asked where he had come up with the name for his imaginary world in the wardrobe, the author showed him an atlas... Read more »
7 days in Normandy                                Part 1, Rouen to Honfleurs

7 days in Normandy Part 1, Rouen to Honfleurs

We start our journey through northern France in Rouen, the region’s capital. Direct flights to Normandy’s two main airports in Rouen and Caen can be a bit pricy, so we advise Beauvais-Paris... Read more »
5 Istanbul Dont’s                                       (As advised by a local)

5 Istanbul Dont’s (As advised by a local)

As the saying goes: “Turkey is too middle-eastern for a westerner, too western for a middle-easterner”. Nowhere does this proverb ring truer than Istanbul. This proud megalopolis (15 million inhabitants as of... Read more »
Copenhagen | A Guide to the Fascinating Danish Capital

Copenhagen | A Guide to the Fascinating Danish Capital

Standing at a crossroads between Scandinavia and central Europe, Copenhagen is a city that defies easy labels. Such defiance, however, is what makes the city such a fascinating place to visit. There... Read more »
Alberobello and the Trulli

Alberobello and the Trulli

Apulia is the region in Southern Italy that occupies the heel of the peninsula. It is known for the dazzling blue sea of the Salento, the rugged white cliffs of the Gargano... Read more »
Yllas | Lapland Under the Northern Lights

Yllas | Lapland Under the Northern Lights

Charming and remote, Yllas is more than just another ski resort area; it’s a window into an often unseen part of Finnish culture. Beloved by Finns and tourists alike, Yllas offers your... Read more »
A note to our visitors

This website has updated its privacy policy in compliance with changes to European Union data protection law, for all members globally. We’ve also updated our Privacy Policy to give you more information about your rights and responsibilities with respect to your privacy and personal information. Please read this to review the updates about which cookies we use and what information we collect on our site. By continuing to use this site, you are agreeing to our updated privacy policy.