{"id":1193767,"date":"2016-11-17T04:03:32","date_gmt":"2016-11-17T12:03:32","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-text\/"},"modified":"2016-11-17T04:03:32","modified_gmt":"2016-11-17T12:03:32","slug":"help-adding-category-to-list-view-with-custom-anchor-text","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-text\/","title":{"rendered":"Help Adding Category To List View With Custom Anchor Text"},"content":{"rendered":"<p>Hi,<\/p>\n<p>A few months ago Cliff very kindly helped me to add a link from the Calendar &#8216;Tooltip&#8217; to the events category page but with custom anchor text. In my case &#8216;More Info&#8217; so I could style it as a button. <\/p>\n<p>He did it by writing this snippet:<\/p>\n<pre><code>&lt;?php\n\/\/ Adapted from https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-tooltip-but-with\/#post-1079625\n\/\/ Demo: http:\/\/cl.ly\/1p1V0n3o3q3s\n$day             = tribe_events_get_current_month_day();\n$event_id        = &quot;{$post-&gt;ID}-{$day[&#039;daynum&#039;]}&quot;;\n$link            = tribe_get_event_link( $post );\n$title           = get_the_title( $post );\n$additional_data = array();\n$category_ids      = tribe_get_event_cat_ids( $event_id );\n$more_info_first_cat = &#039;&#039;;\nif ( ! empty( $category_ids ) &amp;&amp; is_array( $category_ids ) ) {\n  if ( null != $category_ids[0] ) {\n    $more_info_first_cat = sprintf( &#039;&lt;a class=&quot;shaun-more-info-first-category&quot; href=&quot;%s&quot;&gt;More Info&lt;\/a&gt;&#039;, get_term_link( $category_ids[0] ) );\n  }\n}\n$additional_data[&#039;categories&#039;] = $more_info_first_cat;\n?&gt;<\/code><\/pre>\n<p>Which allowed me to then use <\/p>\n<p><code>&lt;p class=&quot;tribe-event-categories&quot;&gt;[[=raw categories]]&lt;\/p&gt;<\/code><\/p>\n<p>In tooltip.php which generated a link to the category with &#8216;More Info&#8217; as the anchor text. examples can be seen here: https:\/\/thorntonandlowe.com\/training\/month\/<\/p>\n<p>I now need to do with same with the events lists on location view. I.e I&#8217;d like a &#8216;More Info&#8217; button next to the price and &#8216;Book Now&#8217; button here: https:\/\/thorntonandlowe.com\/venue\/london\/ that links to the category. <\/p>\n<p>I&#8217;m sure the code that Cliff wrote is already doing most of the hard work but I just need some help figuring how to add the data to the template file. In this case single-event.php as it isn&#8217;t a javascript template like tooltip.php is.<\/p>\n<p>Essentially what I&#8217;m asking is how to I take the contents of Cliff&#8217;s code above but output as PHP rather than [[=raw categories]]. <\/p>\n<p>Thanks in advance for your help.<\/p>\n","protected":false},"template":"","class_list":["post-1193767","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>Help Adding Category To List View With Custom Anchor 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\/help-adding-category-to-list-view-with-custom-anchor-text\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Help Adding Category To List View With Custom Anchor Text -\" \/>\n<meta property=\"og:description\" content=\"Hi, A few months ago Cliff very kindly helped me to add a link from the Calendar &#8216;Tooltip&#8217; to the events category page but with custom anchor text. In my case &#8216;More Info&#8217; so I could style it as a button. He did it by writing this snippet: &lt;?php \/\/ Adapted from https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-tooltip-but-with\/#post-1079625 \/\/ Demo: [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-text\/\" \/>\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\/help-adding-category-to-list-view-with-custom-anchor-text\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-text\/\",\"name\":\"Help Adding Category To List View With Custom Anchor Text -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-11-17T12:03:32+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-text\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-text\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-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\":\"Help Adding Category To List View With Custom Anchor 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":"Help Adding Category To List View With Custom Anchor 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\/help-adding-category-to-list-view-with-custom-anchor-text\/","og_locale":"en_US","og_type":"article","og_title":"Help Adding Category To List View With Custom Anchor Text -","og_description":"Hi, A few months ago Cliff very kindly helped me to add a link from the Calendar &#8216;Tooltip&#8217; to the events category page but with custom anchor text. In my case &#8216;More Info&#8217; so I could style it as a button. He did it by writing this snippet: &lt;?php \/\/ Adapted from https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-tooltip-but-with\/#post-1079625 \/\/ Demo: [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-text\/","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\/help-adding-category-to-list-view-with-custom-anchor-text\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-text\/","name":"Help Adding Category To List View With Custom Anchor Text -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-11-17T12:03:32+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-text\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-text\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/help-adding-category-to-list-view-with-custom-anchor-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":"Help Adding Category To List View With Custom Anchor 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\/1193767","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\/1193767\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1193767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}