Support

Home Forums Event Espresso Premium Change wording of filter by category in [EVENT_CUSTOM_VIEW]

Change wording of filter by category in [EVENT_CUSTOM_VIEW]

Posted: May 3, 2014 at 9:59 am


Paul Green

May 3, 2014 at 9:59 am

I’m using [EVENT_CUSTOM_VIEW] and would like to change the wording at the top from

Filter by category

to

Filter by job role

What would you suggest please? Thank you


Paul Green

May 3, 2014 at 10:01 am

On the same page using the same shortcode, I also want to insert the day of the week before the date.

Is is possible to do that?

Thanks


Dean

May 5, 2014 at 1:25 am

Hi Paul,

You can use the language files to translate the wording, or a function like this (added to your themes functions.php or a custom plugin)

function youruniqueprefix_filter_gettext( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'Filter by category ' => 'Filter by job role '
    );
 
    // See if the current string is in the $strings array
    // If so, replace it's translation
    if ( isset( $strings[$original] ) ) {
        // This accomplishes the same thing as __()
        // but without running it through the filter again
        $translations = &get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
 
    return $translated;
}
 
add_filter( 'gettext', 'youruniqueprefix_filter_gettext', 10, 3 );

For the day of the week you would need to edit the template itself (espresso-custom-templates/templates/events-table/index.php).

Approx line 96 is the following

<td id="start_date-<?php echo $event->id?>" class="start_date"><?php echo event_date_display($event->start_date/*.' '.$event->start_time, get_option('date_format').' '.get_option('time_format')*/) ?></td>

change it to

<td id="start_date-<?php echo $event->id?>" class="start_date"><?php echo date('D', strtotime(event_date_display($event->start_date ) ) ) . ' '; echo event_date_display($event->start_date) ?></td>

You may want to change the D (which displays the day like Mon, Tue, etc) to a different format. You can find all the formats here: http://php.net/manual/en/function.date.php

The support post ‘Change wording of filter by category in [EVENT_CUSTOM_VIEW]’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso