{"id":1409,"date":"2025-02-07T16:28:38","date_gmt":"2025-02-07T22:28:38","guid":{"rendered":"https:\/\/docs.joedolson.com\/my-calendar\/?p=1409"},"modified":"2025-02-07T16:28:39","modified_gmt":"2025-02-07T22:28:39","slug":"php-templates-titles","status":"publish","type":"post","link":"https:\/\/docs.joedolson.com\/my-calendar\/php-templates-titles\/","title":{"rendered":"PHP Templates: Titles"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">My Calendar&#8217;s PHP templates are context sensitive, allowing you to display the title differently in different contexts. There are five different templates targeting title display:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>calendar-title.php<\/code>\n<ul class=\"wp-block-list\">\n<li>Structure the title as shown in the Grid view of the calendar. Equivalent to the settings field at My Calendar > Settings > Display > Event title (Grid). <\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>card-title.php<\/code>\n<ul class=\"wp-block-list\">\n<li>Structure the title as shown in the Card view of the calendar. Equivalent to the settings field at My Calendar > Settings > Display > Event title (Card). <\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>list-title.php<\/code>\n<ul class=\"wp-block-list\">\n<li>Structure the title as shown in the List view of the calendar. Equivalent to the settings field at My Calendar > Settings > Display > Event title (List). <\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>mini-title.php<\/code>\n<ul class=\"wp-block-list\">\n<li>Structure the title as shown in the Mini view of the calendar. Equivalent to the settings field at My Calendar > Settings > Display > Event title (Grid), but allows you to customize the mini calendar separately from the main view.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>single-title.php<\/code>\n<ul class=\"wp-block-list\">\n<li>Structure the title as shown in Single event views of the calendar. Equivalent to the settings field at My Calendar > Settings > Display > Event title (Single). <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">All default <code>{type}-title.php<\/code> templates render the template tags in the related settings field if they have been modified using <code>mc_draw_template()<\/code>. Any event template tag is available for use in the title templates.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Example custom template<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div class=\"mc-title-container\">\n\t&lt;div class=\"mc-image-container\">\n\t\t&lt;?php mc_template_image( $data, 'calendar', 'thumbnail' ); ?>\n\t&lt;\/div>\n\t&lt;div class=\"mc-title-container\">\n\t\t&lt;div class=\"mc-badge-date\">\n\t\t\t&lt;?php mc_template_tag( $data, 'datebadge' ); ?>\n\t\t&lt;\/div>\n\t\t&lt;div class=\"mc-title\">\n\t\t\t&lt;?php mc_template_tag( $data, 'title' ); ?>\n\t\t&lt;\/div>\n\t&lt;\/div>\n&lt;\/div><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This template would output the event image as a thumbnail, the current date in a badge format, and a title, while also adding structural elements for layout purposes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My Calendar&#8217;s PHP templates are context sensitive, allowing you to display the title differently in different contexts. There are five different templates targeting title display: All default {type}-title.php templates render the template tags in the related settings field if they have been modified using mc_draw_template(). Any event template tag is available for use in the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-1409","post","type-post","status-publish","format-standard","hentry","category-design"],"_links":{"self":[{"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/posts\/1409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/comments?post=1409"}],"version-history":[{"count":1,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/posts\/1409\/revisions"}],"predecessor-version":[{"id":1410,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/posts\/1409\/revisions\/1410"}],"wp:attachment":[{"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/media?parent=1409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/categories?post=1409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.joedolson.com\/my-calendar\/wp-json\/wp\/v2\/tags?post=1409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}