Add code to hide event title?
-
Update: Scrap everything I typed below – turns out you can achieve this by using the
contentorder
option, e.g.[ecs-list-events cat="sidebar-feature-event" limit="1" contentorder="thumbnail" thumb="true" thumbsize="large" viewall="false" message=""]
.I should read documentation a little more closely before digging into a plugin’s code. ??
##################################################
I’m developing a site that often uses featured images for events that include most of the relevant details like date, time, location etc (digital flyers). I found myself wanting to display a flyer in a sidebar but didn’t need to output any details about the event, just the thumbnail image. The The Events Calendar Shortcode plugin supports the hiding/showing of date, venue, excerpt, thumbnail etc, but not the title, so I added the relevant code (three lines) to the plugin file.
If anyone else requires this functionality, here’s what to add:
'title' => 'true',
on line 144, under
$atts = shortcode_atts( apply_filters( 'ecs_shortcode_atts', array(
.And:
if ( self::isValid( $atts['title'] ) ) {
on line 298, under
case 'title':
.Then close the if statement with a
}
on line 302, abovebreak;
.Now if you want to hide the title using TECS, add
title="false"
to the shortcode, e.g.[ecs-list-events cat="sidebar-feature-event" limit="1" title="false" thumb="true" thumbsize="large" eventdetails="false" viewall="false" message=""]
.I’m not sure if there’s enough demand to warrant this being included as part of the plugin, but it would save me having to update the plugin’s code every time there’s a new release if it was included. ??
- The topic ‘Add code to hide event title?’ is closed to new replies.