{"id":1186144,"date":"2016-11-01T20:25:59","date_gmt":"2016-11-02T03:25:59","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/"},"modified":"2016-11-01T20:25:59","modified_gmt":"2016-11-02T03:25:59","slug":"use-filter-to-edit-html-around-featured-image","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/","title":{"rendered":"Use filter to edit HTML around featured image"},"content":{"rendered":"<p>Can I use a filter to change the default HTML output around a featured image on a single-event page?<\/p>\n<p>Here is the code from the template:<\/p>\n<pre><code>&lt;!-- Event featured image, but exclude link --&gt;\n\t\t\t&lt;?php echo tribe_event_featured_image( $event_id, &#039;full&#039;, false ); ?&gt;<\/code><\/pre>\n<p>This is the code in the general.php file:<\/p>\n<pre><code>\tfunction tribe_event_featured_image( $post_id = null, $size = &#039;full&#039;, $link = true ) {\n\t\tif ( is_null( $post_id ) ) {\n\t\t\t$post_id = get_the_ID();\n\t\t}\n\n\t\t\/**\n\t\t * Provides an opportunity to modify the featured image size.\n\t\t *\n\t\t * @param string $size\n\t\t * @param int    $post_id\n\t\t *\/\n\t\t$image_html     = get_the_post_thumbnail( $post_id, apply_filters( &#039;tribe_event_featured_image_size&#039;, $size, $post_id ) );\n\t\t$featured_image = &#039;&#039;;\n\n\t\t\/**\n\t\t * Controls whether the featured image should be wrapped in a link\n\t\t * or not.\n\t\t *\n\t\t * @param bool $link\n\t\t *\/\n\t\tif ( ! empty( $image_html ) &amp;&amp; apply_filters( &#039;tribe_event_featured_image_link&#039;, $link ) ) {\n\t\t\t$featured_image .= &#039;&lt;div class=&quot;tribe-events-event-image&quot;&gt;&lt;a href=&quot;&#039; . esc_url( tribe_get_event_link() ) . &#039;&quot;&gt;&#039; . $image_html . &#039;&lt;\/a&gt;&lt;\/div&gt;&#039;;\n\t\t} elseif ( ! empty( $image_html ) ) {\n\t\t\t$featured_image .= &#039;&lt;div class=&quot;tribe-events-event-image&quot;&gt;&#039; . $image_html . &#039;&lt;\/div&gt;&#039;;\n\t\t}\n\n\t\t\/**\n\t\t * Provides an opportunity to modify the featured image HTML.\n\t\t *\n\t\t * @param string $featured_image\n\t\t * @param int    $post_id\n\t\t * @param string $size\n\t\t *\/\n\t\treturn apply_filters( &#039;tribe_event_featured_image&#039;, $featured_image, $post_id, $size );\n\t}<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-1186144","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Use filter to edit HTML around featured image -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Use filter to edit HTML around featured image -\" \/>\n<meta property=\"og:description\" content=\"Can I use a filter to change the default HTML output around a featured image on a single-event page? Here is the code from the template: &lt;!-- Event featured image, but exclude link --&gt; &lt;?php echo tribe_event_featured_image( $event_id, &#039;full&#039;, false ); ?&gt; This is the code in the general.php file: function tribe_event_featured_image( $post_id = null, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/\",\"name\":\"Use filter to edit HTML around featured image -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-11-02T03:25:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Use filter to edit HTML around featured image\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Use filter to edit HTML around featured image -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/","og_locale":"en_US","og_type":"article","og_title":"Use filter to edit HTML around featured image -","og_description":"Can I use a filter to change the default HTML output around a featured image on a single-event page? Here is the code from the template: &lt;!-- Event featured image, but exclude link --&gt; &lt;?php echo tribe_event_featured_image( $event_id, &#039;full&#039;, false ); ?&gt; This is the code in the general.php file: function tribe_event_featured_image( $post_id = null, [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/","name":"Use filter to edit HTML around featured image -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-11-02T03:25:59+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/use-filter-to-edit-html-around-featured-image\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Use filter to edit HTML around featured image"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1186144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1186144\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1186144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}