{"id":1014788,"date":"2015-10-15T02:45:27","date_gmt":"2015-10-15T09:45:27","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/"},"modified":"2015-10-15T06:28:41","modified_gmt":"2015-10-15T13:28:41","slug":"date-function-to-pull-in-images-instead-of-text","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/","title":{"rendered":"Date function to pull in images instead of text"},"content":{"rendered":"<p>I have a website which had a very old version of The Events Calendar, they were pulling in the date and month of each event with images instead of numbers like so: http:\/\/www.agilebear.com\/events<\/p>\n<p>I am trying to get this same code working with the latest version of The Events Calendar. The image block is being pulled in with this code:<\/p>\n<pre><code>&lt;div class=&quot;date-block&quot;&gt;\n\t&lt;? echo dateImage(the_event_start_date($post-&gt;ID, false, &#039;d&#039;), the_event_end_date($post-&gt;ID, false, &#039;d&#039;), the_event_start_date($post-&gt;ID, false, &#039;m&#039;)); ?&gt;\n\t&lt;div class=&quot;bot&quot;&gt;&lt;\/div&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<p>There is also a bit of code in the functions file which I have tried to edit but failed:<\/p>\n<pre><code>\/\/\n\tfunction dateImage($start_date, $end_date = null, $Month)\n\t{\n\t\t$test = false;\n\t \t$dayImageName = $start_date;\n\t \t\/\/2 days\n\t \tif($end_date != null)\n\t \t{\n\t \t\t$dayImageName = $dayImageName . &#039;-&#039; . $end_date;\t\n\t \t}\n\t \t\/\/same day\n\t \tif ($start_date == $end_date)\n\t \t{\n\t \t\t$dayImageName = $start_date;\n\t \t}\n\t \t\/\/more than 2 days chosen - default to show 1st day only\n\t \tif (($end_date - $start_date) &gt;= 2)\n\t \t{\n\t \t\t$dayImageName = $start_date;\n\t \t}\n\t \t\n\t\t$dayImage = &#039;&lt;img src=&quot;&#039; . get_bloginfo(&#039;template_directory&#039;) . &#039;\/images\/furniture\/calendar\/ABC_Day_D_&#039; . $dayImageName . &#039;.gif&quot; alt=&quot;&#039; . $dayImageName . &#039;&quot; width=&quot;60&quot; height=&quot;35&quot; \/&gt;&#039;;\n\t\t$monthImage = &#039;&lt;img src=&quot;&#039; . get_bloginfo(&#039;template_directory&#039;) . &#039;\/images\/furniture\/calendar\/ABC_Month_&#039; . $Month . &#039;.gif&quot; alt=&quot;&#039; . $Month . &#039;&quot; width=&quot;60&quot; height=&quot;15&quot; \/&gt;&#039;;\n\t\tif($test)\n\t\t{\n\t\t\t$testString = $start_date . &quot; : &quot;  . $end_date . &quot; : &quot;  . $Month;\n\t\t}\n\t\treturn $testString . $dayImage . &quot;\\r&quot; . $monthImage;\n\t}<\/code><\/pre>\n<p>What happens is that it calls in an image based on the date &#8211; at the moment the code is pulling in each number for the start day, end day and month but it&#8217;s no corresponding with the code in the functions and pulling in the image. Here is what our testing server looks like: http:\/\/agile.rare-testing.co.uk\/events<\/p>\n<p>Any help and\/or ideas would be much appreciated. <\/p>\n","protected":false},"template":"","class_list":["post-1014788","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>Date function to pull in images instead of text -<\/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\/date-function-to-pull-in-images-instead-of-text\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Date function to pull in images instead of text -\" \/>\n<meta property=\"og:description\" content=\"I have a website which had a very old version of The Events Calendar, they were pulling in the date and month of each event with images instead of numbers like so: http:\/\/www.agilebear.com\/events I am trying to get this same code working with the latest version of The Events Calendar. The image block is being [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-10-15T13:28:41+00:00\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/\",\"name\":\"Date function to pull in images instead of text -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-10-15T09:45:27+00:00\",\"dateModified\":\"2015-10-15T13:28:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/#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\":\"Date function to pull in images instead of text\"}]},{\"@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":"Date function to pull in images instead of text -","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\/date-function-to-pull-in-images-instead-of-text\/","og_locale":"en_US","og_type":"article","og_title":"Date function to pull in images instead of text -","og_description":"I have a website which had a very old version of The Events Calendar, they were pulling in the date and month of each event with images instead of numbers like so: http:\/\/www.agilebear.com\/events I am trying to get this same code working with the latest version of The Events Calendar. The image block is being [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/","article_modified_time":"2015-10-15T13:28:41+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/","name":"Date function to pull in images instead of text -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-10-15T09:45:27+00:00","dateModified":"2015-10-15T13:28:41+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/date-function-to-pull-in-images-instead-of-text\/#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":"Date function to pull in images instead of text"}]},{"@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\/1014788","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":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1014788\/revisions"}],"predecessor-version":[{"id":1014833,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1014788\/revisions\/1014833"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1014788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}