SHARE
TWEET

Untitled

a guest Jan 3rd, 2017 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_filter('relevanssi_excerpt_content', 'custom_fields_to_excerpts', 10, 2);
  2.  
  3. function custom_fields_to_excerpts($content, $post) {
  4.     $image_id = get_post_thumbnail_id();
  5.     $image    = wp_get_attachment_metadata( $image_id);
  6.     $image_meta = $image['image_meta'];
  7.  
  8.     if ($image_meta) {
  9.       foreach($image_meta as $image_meta) {
  10.          
  11.          $date_shoot = date('d-m-Y', $image_metadata['created_timestamp']);
  12.          $content .= " " . $date_shoot;
  13.        }
  14.        
  15.     return $content;
  16.  
  17.   }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top