{"id":1896468,"date":"2019-10-18T13:19:11","date_gmt":"2019-10-18T17:19:11","guid":{"rendered":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/featured-images-2\/"},"modified":"2022-11-28T12:17:39","modified_gmt":"2022-11-28T17:17:39","slug":"featured-images","status":"publish","type":"post","link":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/featured-images\/","title":{"rendered":"Using Featured Images in Events"},"content":{"rendered":"\n<p>You might already be a lot more familiar with how the Featured Image works for The Events Calendar than you know. That&#8217;s because it&#8217;s built on top of the same Featured Image functionality that comes standard with WordPress.<\/p>\n\n\n\n<p>In this post, we&#8217;re going to dive into the concept of Featured Images a little deeper. We&#8217;ll review how to add them to an event post, cover how to style them in CSS and, lastly, how to change the size.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"events\">Adding featured images to an event<\/h2>\n\n\n\n<p>Let&#8217;s say you have the most beautiful photo and it&#8217;s perfect for the event you&#8217;re about to publish on your site. How do we add that?<\/p>\n\n\n\n<p>From the single event editing screen (Events \u2192 Add New), head down to the Featured Image box in the lower right corner of the screen. It can be easy to miss because of how small and buried it is, but this is what you&#8217;re looking for:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/knowledgebase\/wp-content\/uploads\/2020\/02\/admin-editor-featured-image-1024x817.png\" alt=\"\" class=\"wp-image-1946071\"\/><\/figure>\n\n\n\n<p>Go ahead and click the &#8220;Set featured image&#8221; link. It will open a dialogue box that allows you to either select and existing image from your Media Library or upload a new one. Select the image you would like to use as your featured image, click the &#8220;Set featured image&#8221; button in the dialogue box, then you will be taken back to the editing screen and see the featured image in the box.<\/p>\n\n\n\n<p>Need to remove the image and select a new one? Click the &#8220;Replace Image&#8221; button beneath the image and select a new one.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"\/knowledgebase\/wp-content\/uploads\/2020\/02\/admin-editor-featured-image-replace.png\" alt=\"\" class=\"wp-image-1946072\" width=\"355\" height=\"334\"\/><\/figure>\n\n\n\n<p>It&#8217;s worth noting that a featured image is not required for publishing an event. It&#8217;s an optional feature for dressing things up a little bit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"display\">Where featured images are displayed<\/h2>\n\n\n\n<p>Featured images pop up in a few different places. The first place is the calendar views. In list-style views like list, day, and map (Pro only), the image will show next to the event. In month view and Pro&#8217;s week view, the image will show in the mouseover tooltip for each event. If you really want to showcase your featured fmages, you&#8217;ll want to use Pro&#8217;s photo view which shows the photos prominently in a tiled view.<\/p>\n\n\n\n<p>The other place you can expect to see a featured image is on a single event page. It will display at the top of the post, before the content.<\/p>\n\n\n\n<p>In the Block Editor, you can place a featured image block.<\/p>\n\n\n\n<figure class=\"wp-block-image alignnone size-full wp-image-1944088\"><img decoding=\"async\" src=\"\/knowledgebase\/wp-content\/uploads\/2019\/10\/block-editor.png\" alt=\"\" class=\"wp-image-1944088\"\/><figcaption class=\"wp-element-caption\">Inserting a Featured Image in Block Editor<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"css\">Styling a featured image with CSS<\/h2>\n\n\n\n<p>Let&#8217;s say you want to change the featured image so that it floats to the right instead of the left of an event in the calendar view. The Featured Image is always wrapped in the <code>.tribe-events-event-image<\/code> class, so we can use that to make the change in our CSS file.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\n.tribe-events-event-image {\n  float: right;\n}\n<\/pre><\/div>\n\n\n<p>Not bad, right? You can do the same thing to round the corners, add a border and increase the margins:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\n.tribe-events-event-image {\n  border: 1px solid #333;\n  border-radius: 5px;\n  margin-right: 35px;\n}\n<\/pre><\/div>\n\n\n<p>It&#8217;s even possible to hide the image completely from view. For example, this will hide the image from a single event page:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\n.single-tribe_events .tribe-events-event-image {\n  display: none;\n}\n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-background\" style=\"color:#141827;background-color:var(--global-palette8)\">? Interested in knowing more about customizing calendar styles? Check out our <a href=\"https:\/\/dev.theeventscalendar.com\/knowledgebase\/k\/customizing-css\/\">CSS guide<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"size\">Customizing the featured image size<\/h2>\n\n\n\n<p>One thing that comes up from time to time is how to change the size of the featured image. To do this, you will need to create a <a href=\"https:\/\/dev.theeventscalendar.com\/knowledgebase\/k\/customizing-template-files-2\/\">theme override<\/a> of the template where the Featured Image you want to edit is displayed.<\/p>\n\n\n\n<p>In that template, located where the featured image is called. It will look something like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; gutter: false; title: ; notranslate\" title=\"\">\nthe_post_thumbnail( &#039;medium&#039; );\n<\/pre><\/div>\n\n\n<p>See the &#8220;medium&#8221; variable in there? That&#8217;s the size! If your theme follows uses the <a href=\"http:\/\/codex.wordpress.org\/Post_Thumbnails#Thumbnail_Sizes\" target=\"_blank\" rel=\"noopener noreferrer\">standard WordPress sizing conventions for images<\/a>, you can change that to any of the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>thumbnail<\/li>\n\n\n\n<li>medium<\/li>\n\n\n\n<li>large<\/li>\n\n\n\n<li>full<\/li>\n<\/ul>\n\n\n\n<p>If you&#8217;re looking to further customize how WordPress crops your thumbnails, we&#8217;d recommend using <a href=\"https:\/\/wordpress.org\/plugins\/my-eyes-are-up-here\/\" target=\"_blank\" rel=\"noreferrer noopener\">this third-party plugin<\/a> to help you achieve that.<\/p>\n\n\n\n<p>Need more sizes? Head over to the <a href=\"http:\/\/codex.wordpress.org\/Post_Thumbnails#Add_New_Post_Thumbnail_Sizes\" target=\"_blank\" rel=\"noopener noreferrer\">WordPress Codex<\/a> for more info on how to register additional image sizing options.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You might already be a lot more familiar with how the Featured Image works for The Events Calendar than you know. That&#8217;s because it&#8217;s built on top of the same Featured Image functionality that comes standard with WordPress. In this post, we&#8217;re going to dive into the concept of Featured Images a little deeper. We&#8217;ll&#8230;<\/p>\n","protected":false},"author":5,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[130],"tags":[113,115,23],"stellar-product-taxonomy":[161],"class_list":["post-1896468","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advanced-post-manager","tag-block-editor","tag-classic-editor","tag-css","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":130,"label":"Managing Events"}],"post_tag":[{"value":113,"label":"block editor"},{"value":115,"label":"Classic editor"},{"value":23,"label":"CSS"}],"stellar-product-taxonomy":[{"value":161,"label":"The Events Calendar"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Leah","author_link":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/author\/leahk\/"},"comment_info":0,"category_info":[{"term_id":130,"name":"Managing Events","slug":"advanced-post-manager","term_group":0,"term_taxonomy_id":130,"taxonomy":"category","description":"","parent":61,"count":44,"filter":"raw","term_order":"0","cat_ID":130,"category_count":44,"category_description":"","cat_name":"Managing Events","category_nicename":"advanced-post-manager","category_parent":61}],"tag_info":[{"term_id":113,"name":"block editor","slug":"block-editor","term_group":0,"term_taxonomy_id":113,"taxonomy":"post_tag","description":"","parent":27,"count":17,"filter":"raw","term_order":"0"},{"term_id":115,"name":"Classic editor","slug":"classic-editor","term_group":0,"term_taxonomy_id":115,"taxonomy":"post_tag","description":"","parent":27,"count":18,"filter":"raw","term_order":"0"},{"term_id":23,"name":"CSS","slug":"css","term_group":0,"term_taxonomy_id":23,"taxonomy":"post_tag","description":"","parent":20,"count":48,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1896468"}],"version-history":[{"count":1,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896468\/revisions"}],"predecessor-version":[{"id":1956341,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1896468\/revisions\/1956341"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1896468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1896468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1896468"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/dev.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1896468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}