• Resolved seeker286

    (@seeker286)


    For events checked as “All Day,” I want to change the text displayed to “Times vary.” I found the en_GB language file, and a couple of places with code like:

    msgid “All Day”
    msgstr “All Day”

    I’ve tried changing one or both to “Times vary,” but it doesn’t change what’s displayed.

    http://wordpress.org/plugins/events-manager/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    try this snippet

    function my_em_text_rewrites($translation, $orig, $domain) {
    	switch ($orig) {
    		case 'All Day' :
    			$translation = 'Times vary';
    			break;
    	}
    	return $translation;
    }
    add_action ( 'gettext', 'my_em_text_rewrites', 1, 3 );

    As for where to paste this : http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/

    Thread Starter seeker286

    (@seeker286)

    Thanks for the detailed instructions Angelo. The only drawback I see is that this would also change “All Day” elsewhere on the site if the users happened to type that, right? I just want to change it on the events listing:

    http://www.slccsing.org/events/

    That’s why my first instinct was to change it in the Language file. I realize that could be overwritten by future updates.

    Thread Starter seeker286

    (@seeker286)

    I uploaded the code as a plug-in, but it hasn’t changed anything: http://www.slccsing.org/events/.

    Do I need to define the $domain value somewhere?

    Thanks,
    Brian

    Hiya,

    That code would not change any user-entered text, no.

    Have you tried the code in functions.php first? That code works for me which suggests your plugin implementation of it is broken somehow.

    Thanks,
    Phil

    Thread Starter seeker286

    (@seeker286)

    Hi Phil,

    Sorry for the delay. I added the code in functions.php, and I’m still seeing “All Day” instead of “Times vary.” http://www.slccsing.org/events/

    Do I need to change anything in the code – e.g. $domain or can I just copy and paste it?

    I don’t know if it makes a difference, but we’re using Events Manager Pro.

    Thanks,
    Brian

    Plugin Support angelo_nwl

    (@angelo_nwl)

    you can use conditional placeholder {all_day}content{/all_day} for this one at Events > Settings > Formatting > Events > Default event list format

    eg.

    {all_day} Times vary {/all_day}
    {is_long} #_EVENTDATES {/is_long}
    {not_long} #_EVENTDATES {/not_long}

    http://wp-events-plugin.com/documentation/conditional-placeholders/

    Thread Starter seeker286

    (@seeker286)

    Thanks Angelo,

    That’s a more elegant solution, and it gets me closer: http://www.slccsing.org/events/.

    However, {not_all_day} doesn’t seem to be a valid placeholder. Because events checked for “All Day” may be “long” or “not long,” I can’t figure out a way to remove “All Day” from the display.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to change "All Day" text’ is closed to new replies.