Support

Home Forums Event Espresso Premium I want the search bar for EE4 plugin on the basis of events and locations. Reply To: I want the search bar for EE4 plugin on the basis of events and locations.

Reply To: I want the search bar for EE4 plugin on the basis of events and locations.

Author Replies
Josh # Posted on May 7, 2018 at 9:53 am

The featured image ID is stored in wp_postmeta with a meta_key called _thumbnail_id. Example:

meta_id post_id meta_key meta_value
200 4 _thumbnail_id 48

The actual thumbnail link is then contained in wp_posts with a post_type of attachment. Example:

ID post_type guid
48 attachment http://example.com/wp-content/uploads/yourimage.png

Example code for retrieving the featured image outside of the loop follows:

/* get a specific post object by ID */
$post = get_post(2);
  
/* grab the url for the full size featured image */
$featured_img_url = get_the_post_thumbnail_url($post->ID, 'full'); 
 
/* link thumbnail to full size image for use with lightbox*/
echo '<a href="'.$featured_img_url.'" rel="lightbox">'; 
    the_post_thumbnail('thumbnail');
echo '</a>';
Do NOT follow this link or you will be banned from the site!